Class: AttributeEncapsulator
- Inherits:
-
Object
- Object
- AttributeEncapsulator
- Defined in:
- lib/support/attribute_encapsulator.rb
Defined Under Namespace
Classes: AttrStruct
Instance Attribute Summary collapse
-
#attr ⇒ Object
readonly
Returns the value of attribute attr.
Instance Method Summary collapse
-
#initialize(attr) ⇒ AttributeEncapsulator
constructor
A new instance of AttributeEncapsulator.
- #key ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(attr) ⇒ AttributeEncapsulator
Returns a new instance of AttributeEncapsulator.
4 5 6 |
# File 'lib/support/attribute_encapsulator.rb', line 4 def initialize(attr) @attr = AttrStruct.new(attr[0], attr[1]) end |
Instance Attribute Details
#attr ⇒ Object (readonly)
Returns the value of attribute attr.
3 4 5 |
# File 'lib/support/attribute_encapsulator.rb', line 3 def attr @attr end |
Instance Method Details
#key ⇒ Object
8 9 10 |
# File 'lib/support/attribute_encapsulator.rb', line 8 def key attr.key end |
#value ⇒ Object
12 13 14 |
# File 'lib/support/attribute_encapsulator.rb', line 12 def value attr.value end |