Class: ROM::HTTP::Commands::Create
- Inherits:
-
Commands::Create
- Object
- Commands::Create
- ROM::HTTP::Commands::Create
- Defined in:
- lib/rom/http/commands/create.rb
Overview
HTTP Create command
@api public
Instance Method Summary collapse
-
#execute(tuples) ⇒ Object
Submits each of the provided tuples over HTTP post.
Instance Method Details
#execute(tuples) ⇒ Object
Submits each of the provided tuples over HTTP post
15 16 17 18 19 20 |
# File 'lib/rom/http/commands/create.rb', line 15 def execute(tuples) Array([tuples]).flatten.map do |tuple| attributes = input[tuple] relation.insert(attributes.to_h) end.to_a end |