Class: Pebble::Watch::SystemMessageEvent
- Defined in:
- lib/pebble/watch/system_message_event.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
4 5 6 |
# File 'lib/pebble/watch/system_message_event.rb', line 4 def code @code end |
Class Method Details
.parse(message) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/pebble/watch/system_message_event.rb', line 6 def self.parse() event = new event.code = .length == 2 ? .unpack("S>").first : -1 event end |
Instance Method Details
#inspect ⇒ Object
18 19 20 |
# File 'lib/pebble/watch/system_message_event.rb', line 18 def inspect "#{self.} (#{self.code})" end |
#message ⇒ Object
14 15 16 |
# File 'lib/pebble/watch/system_message_event.rb', line 14 def SystemMessages.for_code(self.code) || "Unknown" end |