Class: Sphene::AttributeSet
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Sphene::AttributeSet
- Defined in:
- lib/sphene/attribute_set.rb
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(model) ⇒ AttributeSet
constructor
A new instance of AttributeSet.
- #to_hash ⇒ Object
Constructor Details
#initialize(model) ⇒ AttributeSet
Returns a new instance of AttributeSet.
9 10 11 12 |
# File 'lib/sphene/attribute_set.rb', line 9 def initialize(model) @model = model super({}) end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
7 8 9 |
# File 'lib/sphene/attribute_set.rb', line 7 def model @model end |
Class Method Details
Instance Method Details
#to_hash ⇒ Object
22 23 24 25 26 |
# File 'lib/sphene/attribute_set.rb', line 22 def to_hash each.with_object({}) do |(name, attribute), data| data[name] = attribute.value end end |