Class: GreekFire::SmartLabel
- Inherits:
-
HashWithIndifferentAccess
- Object
- HashWithIndifferentAccess
- GreekFire::SmartLabel
- Defined in:
- app/models/greek_fire/smart_label.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #dup ⇒ Object
-
#initialize(value, key_pairs) ⇒ SmartLabel
constructor
A new instance of SmartLabel.
- #update(other_hash) ⇒ Object
Constructor Details
#initialize(value, key_pairs) ⇒ SmartLabel
Returns a new instance of SmartLabel.
5 6 7 8 |
# File 'app/models/greek_fire/smart_label.rb', line 5 def initialize(value, key_pairs) super(key_pairs) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
3 4 5 |
# File 'app/models/greek_fire/smart_label.rb', line 3 def value @value end |
Instance Method Details
#dup ⇒ Object
16 17 18 19 20 |
# File 'app/models/greek_fire/smart_label.rb', line 16 def dup self.class.new(value, self).tap do |new_hash| set_defaults(new_hash) end end |
#update(other_hash) ⇒ Object
10 11 12 13 14 |
# File 'app/models/greek_fire/smart_label.rb', line 10 def update(other_hash) super(other_hash) @value = other_hash.value if other_hash.is_a? SmartLabel self end |