Class: EmuPower::Notifications::PriceCluster
- Inherits:
-
Notification
- Object
- Notification
- EmuPower::Notifications::PriceCluster
- Defined in:
- lib/emu_power/notifications.rb
Constant Summary
Constants inherited from Notification
Notification::UNIX_TIME_OFFSET
Instance Attribute Summary collapse
-
#currency_code ⇒ Object
This is an ISO 3-digit currency code.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#label ⇒ Object
Returns the value of attribute label.
-
#price ⇒ Object
Returns the value of attribute price.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
-
#tier ⇒ Object
Returns the value of attribute tier.
-
#trailing_digits ⇒ Object
Returns the value of attribute trailing_digits.
Attributes inherited from Notification
#device_mac, #meter_mac, #raw, #timestamp
Instance Method Summary collapse
Methods inherited from Notification
#initialize, #parse_amount, #parse_bool, #parse_hex, #parse_timestamp, root_name, subclasses, #to_s
Constructor Details
This class inherits a constructor from EmuPower::Notifications::Notification
Instance Attribute Details
#currency_code ⇒ Object
This is an ISO 3-digit currency code. 840 is USD
329 330 331 |
# File 'lib/emu_power/notifications.rb', line 329 def currency_code @currency_code end |
#duration ⇒ Object
Returns the value of attribute duration.
333 334 335 |
# File 'lib/emu_power/notifications.rb', line 333 def duration @duration end |
#label ⇒ Object
Returns the value of attribute label.
334 335 336 |
# File 'lib/emu_power/notifications.rb', line 334 def label @label end |
#price ⇒ Object
Returns the value of attribute price.
328 329 330 |
# File 'lib/emu_power/notifications.rb', line 328 def price @price end |
#start_time ⇒ Object
Returns the value of attribute start_time.
332 333 334 |
# File 'lib/emu_power/notifications.rb', line 332 def start_time @start_time end |
#tier ⇒ Object
Returns the value of attribute tier.
331 332 333 |
# File 'lib/emu_power/notifications.rb', line 331 def tier @tier end |
#trailing_digits ⇒ Object
Returns the value of attribute trailing_digits.
330 331 332 |
# File 'lib/emu_power/notifications.rb', line 330 def trailing_digits @trailing_digits end |
Instance Method Details
#build(hash) ⇒ Object
336 337 338 339 340 341 342 343 344 |
# File 'lib/emu_power/notifications.rb', line 336 def build(hash) self.price = parse_hex('Price') self.currency_code = parse_hex('Currency') self.trailing_digits = parse_hex('TrailingDigits') self.tier = parse_hex('Tier') self.start_time = ('StartTime') self.duration = parse_hex('Duration') self.label = hash['RateLabel'] end |