Sha256: b3971415696b6446eed90e80d3e81f0225955a8834db4047c0375d854f894732

Contents?: true

Size: 596 Bytes

Versions: 28

Compression:

Stored size: 596 Bytes

Contents

module ROM
  module Commands
    class Lazy
      class Create < Lazy
        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

28 entries across 28 versions & 2 rubygems

Version Path
rom-3.3.3 lib/rom/commands/lazy/create.rb
rom-3.3.2 lib/rom/commands/lazy/create.rb
rom-core-4.0.0.beta3 lib/rom/commands/lazy/create.rb
rom-3.3.1 lib/rom/commands/lazy/create.rb
rom-core-4.0.0.beta2 lib/rom/commands/lazy/create.rb
rom-3.3.0 lib/rom/commands/lazy/create.rb
rom-core-4.0.0.beta1 lib/rom/commands/lazy/create.rb
rom-3.2.3 lib/rom/commands/lazy/create.rb
rom-3.2.2 lib/rom/commands/lazy/create.rb
rom-3.2.1 lib/rom/commands/lazy/create.rb
rom-3.2.0 lib/rom/commands/lazy/create.rb
rom-3.1.0 lib/rom/commands/lazy/create.rb
rom-3.0.3 lib/rom/commands/lazy/create.rb
rom-3.0.2 lib/rom/commands/lazy/create.rb
rom-3.0.1 lib/rom/commands/lazy/create.rb
rom-3.0.0 lib/rom/commands/lazy/create.rb
rom-3.0.0.rc2 lib/rom/commands/lazy/create.rb
rom-3.0.0.rc1 lib/rom/commands/lazy/create.rb
rom-3.0.0.beta3 lib/rom/commands/lazy/create.rb
rom-3.0.0.beta2 lib/rom/commands/lazy/create.rb