Class: EmuPower::Notifications::LastPeriodUsage
- Inherits:
-
Notification
- Object
- Notification
- EmuPower::Notifications::LastPeriodUsage
- Defined in:
- lib/emu_power/notifications.rb
Constant Summary
Constants inherited from Notification
Notification::UNIX_TIME_OFFSET
Instance Attribute Summary collapse
-
#digits_left ⇒ Object
Returns the value of attribute digits_left.
-
#digits_right ⇒ Object
Returns the value of attribute digits_right.
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#suppress_leading_zeroes ⇒ Object
Returns the value of attribute suppress_leading_zeroes.
-
#usage ⇒ Object
Returns the value of attribute usage.
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
#digits_left ⇒ Object
Returns the value of attribute digits_left.
276 277 278 |
# File 'lib/emu_power/notifications.rb', line 276 def digits_left @digits_left end |
#digits_right ⇒ Object
Returns the value of attribute digits_right.
275 276 277 |
# File 'lib/emu_power/notifications.rb', line 275 def digits_right @digits_right end |
#end_date ⇒ Object
Returns the value of attribute end_date.
279 280 281 |
# File 'lib/emu_power/notifications.rb', line 279 def end_date @end_date end |
#start_date ⇒ Object
Returns the value of attribute start_date.
278 279 280 |
# File 'lib/emu_power/notifications.rb', line 278 def start_date @start_date end |
#suppress_leading_zeroes ⇒ Object
Returns the value of attribute suppress_leading_zeroes.
277 278 279 |
# File 'lib/emu_power/notifications.rb', line 277 def suppress_leading_zeroes @suppress_leading_zeroes end |
#usage ⇒ Object
Returns the value of attribute usage.
274 275 276 |
# File 'lib/emu_power/notifications.rb', line 274 def usage @usage end |
Instance Method Details
#build(hash) ⇒ Object
281 282 283 284 285 286 287 288 |
# File 'lib/emu_power/notifications.rb', line 281 def build(hash) self.usage = parse_amount('LastUsage') self.digits_right = parse_hex('DigitsRight') self.digits_left = parse_hex('DigitsLeft') self.suppress_leading_zeroes = parse_bool('SuppressLeadingZero') self.start_date = ('StartDate') self.end_date = ('EndDate') end |