Class: Tanuki_Attribute
Instance Method Summary collapse
-
#initialize(cfg, owner) ⇒ Tanuki_Attribute
constructor
A new instance of Tanuki_Attribute.
- #required? ⇒ Boolean
- #value ⇒ Object
Constructor Details
#initialize(cfg, owner) ⇒ Tanuki_Attribute
Returns a new instance of Tanuki_Attribute.
2 3 4 5 6 7 8 9 10 |
# File 'app/tanuki/attribute/attribute.rb', line 2 def initialize(cfg, owner) #-- # created on demand (first access) # cfg is a parsed yaml hash # attribute owner object # all Object and Collection attrs are defined in relations @cfg = cfg @owner = owner end |
Instance Method Details
#required? ⇒ Boolean
12 13 14 |
# File 'app/tanuki/attribute/attribute.rb', line 12 def required? @cfg[:required] end |
#value ⇒ Object
16 17 18 |
# File 'app/tanuki/attribute/attribute.rb', line 16 def value # value of data (scalar, array, or hash) end |