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
13 14 15 16 17 18 19 |
# File 'lib/rom/http/commands/create.rb', line 13 def execute(tuples) Array([tuples]).flatten.map do |tuple| attributes = input[tuple] validator.call(attributes) relation.insert(attributes.to_h) end.to_a end |