Class: TimexDatalinkClient::Protocol4::Eeprom::PhoneNumber
- Inherits:
-
Object
- Object
- TimexDatalinkClient::Protocol4::Eeprom::PhoneNumber
- Defined in:
- lib/timex_datalink_client/protocol_4/eeprom/phone_number.rb
Constant Summary collapse
- PHONE_DIGITS =
12
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
-
#name ⇒ Object
Returns the value of attribute name.
-
#number ⇒ Object
Returns the value of attribute number.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name:, number:, type: " ") ⇒ PhoneNumber
constructor
Create a PhoneNumber instance.
-
#packet ⇒ Array<Integer>
Compile a packet for a phone number.
Methods included from Helpers::CharEncoders
#chars_for, #eeprom_chars_for, #phone_chars_for, #protocol_6_chars_for
Constructor Details
#initialize(name:, number:, type: " ") ⇒ PhoneNumber
Create a PhoneNumber instance.
23 24 25 26 27 |
# File 'lib/timex_datalink_client/protocol_4/eeprom/phone_number.rb', line 23 def initialize(name:, number:, type: " ") @name = name @number = number @type = type end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
15 16 17 |
# File 'lib/timex_datalink_client/protocol_4/eeprom/phone_number.rb', line 15 def name @name end |
#number ⇒ Object
Returns the value of attribute number.
15 16 17 |
# File 'lib/timex_datalink_client/protocol_4/eeprom/phone_number.rb', line 15 def number @number end |
#type ⇒ Object
Returns the value of attribute type.
15 16 17 |
# File 'lib/timex_datalink_client/protocol_4/eeprom/phone_number.rb', line 15 def type @type end |
Instance Method Details
#packet ⇒ Array<Integer>
Compile a packet for a phone number.
32 33 34 35 36 37 |
# File 'lib/timex_datalink_client/protocol_4/eeprom/phone_number.rb', line 32 def packet [ number_with_type_characters, name_characters ].flatten end |