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

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

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