Class: GreekFire::SmartLabel

Inherits:
HashWithIndifferentAccess
  • Object
show all
Defined in:
app/models/greek_fire/smart_label.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#valueObject (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

#dupObject



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