Module: Property::Attribute::InstanceMethods

Defined in:
lib/property/attribute.rb

Instance Method Summary collapse

Instance Method Details

#propertiesObject Also known as: prop



84
85
86
# File 'lib/property/attribute.rb', line 84

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.



94
95
96
97
# File 'lib/property/attribute.rb', line 94

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.



102
103
104
# File 'lib/property/attribute.rb', line 102

def reload_properties!
  @properties = load_properties
end