Module: Property::Attribute::InstanceMethods
- Defined in:
- lib/property/attribute.rb
Instance Method Summary collapse
- #properties ⇒ Object (also: #prop)
-
#properties=(new_properties) ⇒ Object
(also: #prop=)
Define a set of properties.
-
#reload_properties! ⇒ Object
Force a reload of the properties from the ones stored in the database.
Instance Method Details
#properties ⇒ Object Also known as: prop
71 72 73 |
# File 'lib/property/attribute.rb', line 71 def properties @properties ||= load_properties end |
#properties=(new_properties) ⇒ Object Also known as: prop=
Define a set of properties. This acts like ‘attributes=’: it merges the current properties with the list of provided key/values. Note that unlike ‘attributes=’, the keys must be provided as strings, not symbols. For efficiency reasons and simplification of the API, we do not convert from symbols.
81 82 83 84 |
# File 'lib/property/attribute.rb', line 81 def properties=(new_properties) return if new_properties.nil? properties.merge!(new_properties) end |
#reload_properties! ⇒ Object
Force a reload of the properties from the ones stored in the database.
89 90 91 |
# File 'lib/property/attribute.rb', line 89 def reload_properties! @properties = load_properties end |