Class: EmuPower::Notifications::CurrentSummationDelivered

Inherits:
Notification
  • Object
show all
Defined in:
lib/emu_power/notifications.rb

Constant Summary

Constants inherited from Notification

Notification::UNIX_TIME_OFFSET

Instance Attribute Summary collapse

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

#deliveredObject

Returns the value of attribute delivered.



310
311
312
# File 'lib/emu_power/notifications.rb', line 310

def delivered
  @delivered
end

#digits_leftObject

Returns the value of attribute digits_left.



313
314
315
# File 'lib/emu_power/notifications.rb', line 313

def digits_left
  @digits_left
end

#digits_rightObject

Returns the value of attribute digits_right.



312
313
314
# File 'lib/emu_power/notifications.rb', line 312

def digits_right
  @digits_right
end

#receivedObject

Returns the value of attribute received.



311
312
313
# File 'lib/emu_power/notifications.rb', line 311

def received
  @received
end

#suppress_leading_zeroesObject

Returns the value of attribute suppress_leading_zeroes.



314
315
316
# File 'lib/emu_power/notifications.rb', line 314

def suppress_leading_zeroes
  @suppress_leading_zeroes
end

Instance Method Details

#build(hash) ⇒ Object



316
317
318
319
320
321
322
# File 'lib/emu_power/notifications.rb', line 316

def build(hash)
	self.delivered = parse_amount('SummationDelivered')
	self.received = parse_amount('SummationReceived')
	self.digits_right = parse_hex('DigitsRight')
	self.digits_left = parse_hex('DigitsLeft')
	self.suppress_leading_zeroes = parse_bool('SuppressLeadingZero')
end