Class: TracksAttributes::AttrInfo
- Inherits:
-
Object
- Object
- TracksAttributes::AttrInfo
- Defined in:
- lib/tracks_attributes/attr_info.rb
Overview
Holds the information needed by a class including TracksAttributes in order to track information that can be effectively used to re-hydrate instances from JSON or XML
Instance Attribute Summary collapse
-
#is_readable ⇒ Object
Returns the value of attribute is_readable.
-
#is_writeable ⇒ Object
Returns the value of attribute is_writeable.
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(props = {}) ⇒ AttrInfo
constructor
Props * :name - the attribute name * :kass - the attribute class * :is_readable - true if the attribute is readable * :is_writeable - true if the attribute is writeable.
Constructor Details
#initialize(props = {}) ⇒ AttrInfo
Props
* :name - the attribute name
* :kass - the attribute class
* :is_readable - true if the attribute is readable
* :is_writeable - true if the attribute is writeable
16 17 18 19 20 21 |
# File 'lib/tracks_attributes/attr_info.rb', line 16 def initialize(props = {}) self.name = props[:name] self.klass = props[:klass] self.is_readable = props[:is_readable] || true self.is_writeable = props[:is_writeable] || true end |
Instance Attribute Details
#is_readable ⇒ Object
Returns the value of attribute is_readable.
7 8 9 |
# File 'lib/tracks_attributes/attr_info.rb', line 7 def is_readable @is_readable end |
#is_writeable ⇒ Object
Returns the value of attribute is_writeable.
7 8 9 |
# File 'lib/tracks_attributes/attr_info.rb', line 7 def is_writeable @is_writeable end |
#klass ⇒ Object
Returns the value of attribute klass.
7 8 9 |
# File 'lib/tracks_attributes/attr_info.rb', line 7 def klass @klass end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/tracks_attributes/attr_info.rb', line 7 def name @name end |