Sha256: 17b1174d049554e8ef10fc41c2c90091d5ff4d90a90f747c236dc1ac046c3666
Contents?: true
Size: 826 Bytes
Versions: 10
Compression:
Stored size: 826 Bytes
Contents
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
10 entries across 10 versions & 1 rubygems