Sha256: 06fd638a6bfea528941ab97d76ed6c13f26f27b87de67c3450ac2b20e7c1ad4d
Contents?: true
Size: 857 Bytes
Versions: 6
Compression:
Stored size: 857 Bytes
Contents
# frozen_string_literal: true module ROM module Commands class Lazy # Lazy command wrapper for create commands # # @api public class Create < Lazy # Execute a command # # @see Command::Create#call # # @return [Hash,Array<Hash>] # # @api public def call(*args) first = args.first last = args.last size = args.size if size > 1 && last.is_a?(Array) last.map.with_index do |parent, index| children = evaluator.call(first, index) command_proc[command, parent, children].call(children, parent) end.reduce(:concat) else input = evaluator.call(first) command.call(input, *args[1..size-1]) end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems