Class: Dynamoid::Persistence::ItemUpdaterWithCastingAndDumping

Inherits:
Object
  • Object
show all
Defined in:
lib/dynamoid/persistence/item_updater_with_casting_and_dumping.rb

Instance Method Summary collapse

Constructor Details

#initialize(model_class, item_updater) ⇒ ItemUpdaterWithCastingAndDumping

Returns a new instance of ItemUpdaterWithCastingAndDumping.



7
8
9
10
# File 'lib/dynamoid/persistence/item_updater_with_casting_and_dumping.rb', line 7

def initialize(model_class, item_updater)
  @model_class = model_class
  @item_updater = item_updater
end

Instance Method Details

#add(attributes) ⇒ Object



12
13
14
# File 'lib/dynamoid/persistence/item_updater_with_casting_and_dumping.rb', line 12

def add(attributes)
  @item_updater.add(cast_and_dump(attributes))
end

#set(attributes) ⇒ Object



16
17
18
# File 'lib/dynamoid/persistence/item_updater_with_casting_and_dumping.rb', line 16

def set(attributes)
  @item_updater.set(cast_and_dump(attributes))
end