Class: Opto::Model::Attribute
- Inherits:
-
Object
- Object
- Opto::Model::Attribute
- Defined in:
- lib/opto/model/attribute.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
-
#handler ⇒ Object
readonly
Returns the value of attribute handler.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(collection, definition, handler) ⇒ Attribute
constructor
A new instance of Attribute.
- #set(value) ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(collection, definition, handler) ⇒ Attribute
Returns a new instance of Attribute.
9 10 11 12 13 14 |
# File 'lib/opto/model/attribute.rb', line 9 def initialize(collection, definition, handler) @collection = collection @definition = definition @handler = handler @name = definition[:name] end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
5 6 7 |
# File 'lib/opto/model/attribute.rb', line 5 def collection @collection end |
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
4 5 6 |
# File 'lib/opto/model/attribute.rb', line 4 def definition @definition end |
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
6 7 8 |
# File 'lib/opto/model/attribute.rb', line 6 def handler @handler end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/opto/model/attribute.rb', line 7 def name @name end |
Instance Method Details
#set(value) ⇒ Object
16 17 18 |
# File 'lib/opto/model/attribute.rb', line 16 def set(value) handler.set(value) end |
#value ⇒ Object
20 21 22 |
# File 'lib/opto/model/attribute.rb', line 20 def value handler.value end |