Class: ROM::Memory::Commands::Create

Inherits:
Commands::Create show all
Defined in:
lib/rom/memory/commands.rb

Overview

In-memory create command

Instance Method Summary collapse

Instance Method Details

#execute(tuples) ⇒ Object

See Also:

  • Commands::Create#execute


20
21
22
23
24
25
26
# File 'lib/rom/memory/commands.rb', line 20

def execute(tuples)
  Array([tuples]).flatten.map { |tuple|
    attributes = input[tuple]
    relation.insert(attributes.to_h)
    attributes
  }.to_a
end