Class: ROM::HTTP::Commands::Update
- Inherits:
-
Commands::Update
- Object
- Commands::Update
- ROM::HTTP::Commands::Update
- Defined in:
- lib/rom/http/commands/update.rb
Overview
HTTP update command
Instance Method Summary collapse
- #assert_tuple_count ⇒ Object
-
#execute(tuples) ⇒ Object
Submits each of the provided tuples via HTTP put.
Instance Method Details
#assert_tuple_count ⇒ Object
22 23 24 |
# File 'lib/rom/http/commands/update.rb', line 22 def assert_tuple_count # noop end |
#execute(tuples) ⇒ Object
Submits each of the provided tuples via HTTP put
15 16 17 18 19 20 |
# File 'lib/rom/http/commands/update.rb', line 15 def execute(tuples) Array([tuples]).flatten.map do |tuple| attributes = input[tuple] relation.update(attributes.to_h) end.to_a end |