Method: Dynamoid::Fields#write_attribute

Defined in:
lib/dynamoid/fields.rb

#write_attribute(name, value) ⇒ Object Also known as: []=

Write an attribute on the object. Also marks the previous value as dirty.

Parameters:

  • name (Symbol)

    the name of the field

  • value (Object)

    the value to assign to that field

Since:

  • 0.2.0



115
116
117
118
119
120
121
# File 'lib/dynamoid/fields.rb', line 115

def write_attribute(name, value)
  if association = @associations[name]
    association.reset
  end

  attributes[name.to_sym] = value
end