Class: AttrObject::Manager
- Inherits:
-
Object
- Object
- AttrObject::Manager
- Defined in:
- lib/attr_object/manager.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
- #get(attribute) ⇒ Object
-
#initialize ⇒ Manager
constructor
A new instance of Manager.
- #set(klass, attribute, value) ⇒ Object
Constructor Details
#initialize ⇒ Manager
Returns a new instance of Manager.
5 6 7 |
# File 'lib/attr_object/manager.rb', line 5 def initialize @attributes = {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/attr_object/manager.rb', line 3 def attributes @attributes end |
Instance Method Details
#get(attribute) ⇒ Object
13 14 15 16 |
# File 'lib/attr_object/manager.rb', line 13 def get attribute return if @attributes[attribute].nil? @attributes[attribute].cast end |