Module: Hashme::Properties
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/hashme/properties.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #attributes=(attrs = {}) ⇒ Object
- #get_attribute(name) ⇒ Object
- #set_attribute(name, value) ⇒ Object
Instance Method Details
#attributes=(attrs = {}) ⇒ Object
21 22 23 |
# File 'lib/hashme/properties.rb', line 21 def attributes=(attrs = {}) set_attributes(attrs) end |
#get_attribute(name) ⇒ Object
10 11 12 |
# File 'lib/hashme/properties.rb', line 10 def get_attribute(name) self[name] end |
#set_attribute(name, value) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/hashme/properties.rb', line 14 def set_attribute(name, value) property = get_property(name) if property self[property.name] = property.build(self, value) end end |