Class: EmuPower::Notifications::MessageCluster
- Inherits:
-
Notification
- Object
- Notification
- EmuPower::Notifications::MessageCluster
- Defined in:
- lib/emu_power/notifications.rb
Constant Summary
Constants inherited from Notification
Notification::UNIX_TIME_OFFSET
Instance Attribute Summary collapse
-
#confirmation_required ⇒ Object
Returns the value of attribute confirmation_required.
-
#confirmed ⇒ Object
Returns the value of attribute confirmed.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#id ⇒ Object
Returns the value of attribute id.
-
#priority ⇒ Object
Returns the value of attribute priority.
-
#queue ⇒ Object
Returns the value of attribute queue.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
-
#text ⇒ Object
Returns the value of attribute text.
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
#confirmation_required ⇒ Object
Returns the value of attribute confirmation_required.
134 135 136 |
# File 'lib/emu_power/notifications.rb', line 134 def confirmation_required @confirmation_required end |
#confirmed ⇒ Object
Returns the value of attribute confirmed.
135 136 137 |
# File 'lib/emu_power/notifications.rb', line 135 def confirmed @confirmed end |
#duration ⇒ Object
Returns the value of attribute duration.
133 134 135 |
# File 'lib/emu_power/notifications.rb', line 133 def duration @duration end |
#id ⇒ Object
Returns the value of attribute id.
129 130 131 |
# File 'lib/emu_power/notifications.rb', line 129 def id @id end |
#priority ⇒ Object
Returns the value of attribute priority.
131 132 133 |
# File 'lib/emu_power/notifications.rb', line 131 def priority @priority end |
#queue ⇒ Object
Returns the value of attribute queue.
136 137 138 |
# File 'lib/emu_power/notifications.rb', line 136 def queue @queue end |
#start_time ⇒ Object
Returns the value of attribute start_time.
132 133 134 |
# File 'lib/emu_power/notifications.rb', line 132 def start_time @start_time end |
#text ⇒ Object
Returns the value of attribute text.
130 131 132 |
# File 'lib/emu_power/notifications.rb', line 130 def text @text end |
Instance Method Details
#build(hash) ⇒ Object
138 139 140 141 142 143 144 145 146 147 |
# File 'lib/emu_power/notifications.rb', line 138 def build(hash) self.id = hash['Id'] self.text = hash['Text'] self.priority = hash['Priority'] self.start_time = ('StartTime') self.duration = parse_hex('Duration') self.confirmation_required = parse_bool('ConfirmationRequired') self.confirmed = parse_bool('Confirmed') self.queue = hash['Queue'] end |