Module: Dynamoid::Attributes
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#attributes ⇒ Object
(also: #raw_attributes)
Returns the value of attribute attributes.
Instance Method Summary collapse
- #read_attribute(name) ⇒ Object (also: #[])
- #update_attribute(attribute, value) ⇒ Object
- #update_attributes(attributes) ⇒ Object
- #write_attribute(name, value) ⇒ Object (also: #[]=)
Instance Attribute Details
#attributes ⇒ Object Also known as: raw_attributes
Returns the value of attribute attributes.
7 8 9 |
# File 'lib/dynamoid/attributes.rb', line 7 def attributes @attributes end |
Instance Method Details
#read_attribute(name) ⇒ Object Also known as: []
15 16 17 |
# File 'lib/dynamoid/attributes.rb', line 15 def read_attribute(name) attributes[name.to_sym] end |
#update_attribute(attribute, value) ⇒ Object
25 26 27 28 |
# File 'lib/dynamoid/attributes.rb', line 25 def update_attribute(attribute, value) self.attributes[attribute] = value save end |
#update_attributes(attributes) ⇒ Object
20 21 22 23 |
# File 'lib/dynamoid/attributes.rb', line 20 def update_attributes(attributes) self.attributes = self.attributes.merge(attributes) save end |
#write_attribute(name, value) ⇒ Object Also known as: []=
10 11 12 |
# File 'lib/dynamoid/attributes.rb', line 10 def write_attribute(name, value) attributes[name.to_sym] = value end |