Class: Lyra::Item
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#property_name ⇒ Object
readonly
Returns the value of attribute property_name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(hash: Hash) ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize(hash: Hash) ⇒ Item
Returns a new instance of Item.
8 9 10 11 12 13 |
# File 'lib/lyra/item.rb', line 8 def initialize(hash: Hash) hash = hash.transform_keys(&:to_sym) @key = hash[:key] @property_name = hash[:property_name] @value = '' end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
4 5 6 |
# File 'lib/lyra/item.rb', line 4 def key @key end |
#property_name ⇒ Object (readonly)
Returns the value of attribute property_name.
5 6 7 |
# File 'lib/lyra/item.rb', line 5 def property_name @property_name end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/lyra/item.rb', line 6 def value @value end |