Class: TimexDatalinkClient::Protocol4::Eeprom::List

Inherits:
Object
  • Object
show all
Includes:
Helpers::CharEncoders, Helpers::LengthPacketWrapper
Defined in:
lib/timex_datalink_client/protocol_4/eeprom/list.rb

Constant Summary

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

Instance Method Summary collapse

Methods included from Helpers::CharEncoders

#chars_for, #eeprom_chars_for, #phone_chars_for

Constructor Details

#initialize(list_entry:, priority:) ⇒ List

Create a List instance.



20
21
22
23
# File 'lib/timex_datalink_client/protocol_4/eeprom/list.rb', line 20

def initialize(list_entry:, priority:)
  @list_entry = list_entry
  @priority = priority
end

Instance Attribute Details

#list_entryObject

Returns the value of attribute list_entry.



13
14
15
# File 'lib/timex_datalink_client/protocol_4/eeprom/list.rb', line 13

def list_entry
  @list_entry
end

#priorityObject

Returns the value of attribute priority.



13
14
15
# File 'lib/timex_datalink_client/protocol_4/eeprom/list.rb', line 13

def priority
  @priority
end

Instance Method Details

#packetArray<Integer>

Compile a packet for a list.



28
29
30
31
32
33
# File 'lib/timex_datalink_client/protocol_4/eeprom/list.rb', line 28

def packet
  [
    priority,
    list_entry_characters
  ].flatten
end