Class: TimexDatalinkClient::Protocol9::TimeName
- Inherits:
-
Object
- Object
- TimexDatalinkClient::Protocol9::TimeName
- Includes:
- Helpers::CharEncoders, Helpers::CrcPacketsWrapper
- Defined in:
- lib/timex_datalink_client/protocol_9/time_name.rb
Constant Summary collapse
- CPACKET_NAME =
[0x31]
Constants included from Helpers::CharEncoders
Helpers::CharEncoders::CHARS, Helpers::CharEncoders::EEPROM_CHARS, Helpers::CharEncoders::EEPROM_TERMINATOR, Helpers::CharEncoders::INVALID_CHAR, Helpers::CharEncoders::PHONE_CHARS
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#zone ⇒ Object
Returns the value of attribute zone.
Instance Method Summary collapse
-
#initialize(zone:, name:) ⇒ TimeName
constructor
Create a TimeName instance.
-
#packets ⇒ Array<Array<Integer>>
Compile packets for a time name.
Methods included from Helpers::CharEncoders
#chars_for, #eeprom_chars_for, #phone_chars_for
Constructor Details
#initialize(zone:, name:) ⇒ TimeName
Create a TimeName instance.
21 22 23 24 |
# File 'lib/timex_datalink_client/protocol_9/time_name.rb', line 21 def initialize(zone:, name:) @zone = zone @name = name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
14 15 16 |
# File 'lib/timex_datalink_client/protocol_9/time_name.rb', line 14 def name @name end |
#zone ⇒ Object
Returns the value of attribute zone.
14 15 16 |
# File 'lib/timex_datalink_client/protocol_9/time_name.rb', line 14 def zone @zone end |
Instance Method Details
#packets ⇒ Array<Array<Integer>>
Compile packets for a time name.
29 30 31 32 33 34 35 36 37 |
# File 'lib/timex_datalink_client/protocol_9/time_name.rb', line 29 def packets [ [ CPACKET_NAME, zone, name_characters ].flatten ] end |