Class: ROM::DynamoDB::Commands::Update

Inherits:
Commands::Update
  • Object
show all
Defined in:
lib/rom/dynamodb/commands/update.rb

Instance Method Summary collapse

Instance Method Details

#execute(attributes) ⇒ Object



7
8
9
# File 'lib/rom/dynamodb/commands/update.rb', line 7

def execute(attributes)
  relation.to_a.collect { |tuple| with_tuple(tuple, attributes) }
end

#with_tuple(tuple, attributes) ⇒ Object



11
12
13
14
# File 'lib/rom/dynamodb/commands/update.rb', line 11

def with_tuple(tuple, attributes)
  data = tuple.is_a?(Hash) ? tuple : tuple.to_h
  relation.update(input[data], attributes.to_h)
end