Class: TimexDatalinkClient::Protocol1::Eeprom::List
- Inherits:
-
Object
- Object
- TimexDatalinkClient::Protocol1::Eeprom::List
- Includes:
- ActiveModel::Validations, Helpers::CharEncoders, Helpers::LengthPacketWrapper
- Defined in:
- lib/timex_datalink_client/protocol_1/eeprom/list.rb
Constant Summary
Constants included from Helpers::CharEncoders
Helpers::CharEncoders::CHARS, Helpers::CharEncoders::CHARS_PROTOCOL_6, Helpers::CharEncoders::EEPROM_CHARS, Helpers::CharEncoders::EEPROM_TERMINATOR, Helpers::CharEncoders::INVALID_CHAR, Helpers::CharEncoders::PHONE_CHARS
Instance Attribute Summary collapse
-
#list_entry ⇒ Object
Returns the value of attribute list_entry.
-
#priority ⇒ Object
Returns the value of attribute priority.
Instance Method Summary collapse
-
#initialize(list_entry:, priority:) ⇒ List
constructor
Create a List instance.
-
#packet ⇒ Array<Integer>
Compile a packet for a list.
Methods included from Helpers::CharEncoders
#chars_for, #eeprom_chars_for, #phone_chars_for, #protocol_6_chars_for
Constructor Details
#initialize(list_entry:, priority:) ⇒ List
Create a List instance.
29 30 31 32 |
# File 'lib/timex_datalink_client/protocol_1/eeprom/list.rb', line 29 def initialize(list_entry:, priority:) @list_entry = list_entry @priority = priority end |
Instance Attribute Details
#list_entry ⇒ Object
Returns the value of attribute list_entry.
16 17 18 |
# File 'lib/timex_datalink_client/protocol_1/eeprom/list.rb', line 16 def list_entry @list_entry end |
#priority ⇒ Object
Returns the value of attribute priority.
16 17 18 |
# File 'lib/timex_datalink_client/protocol_1/eeprom/list.rb', line 16 def priority @priority end |
Instance Method Details
#packet ⇒ Array<Integer>
Compile a packet for a list.
38 39 40 41 42 43 44 45 |
# File 'lib/timex_datalink_client/protocol_1/eeprom/list.rb', line 38 def packet validate! [ priority_value, list_entry_characters ].flatten end |