Class: TimexDatalinkClient::Protocol3::Eeprom::Anniversary
- Inherits:
-
Object
- Object
- TimexDatalinkClient::Protocol3::Eeprom::Anniversary
- Defined in:
- lib/timex_datalink_client/protocol_3/eeprom/anniversary.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
-
#anniversary ⇒ Object
Returns the value of attribute anniversary.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(time:, anniversary:) ⇒ Anniversary
constructor
Create an Anniversary instance.
-
#packet ⇒ Array<Integer>
Compile a packet for an anniversary.
Methods included from Helpers::CharEncoders
#chars_for, #eeprom_chars_for, #phone_chars_for, #protocol_6_chars_for
Constructor Details
#initialize(time:, anniversary:) ⇒ Anniversary
Create an Anniversary instance.
20 21 22 23 |
# File 'lib/timex_datalink_client/protocol_3/eeprom/anniversary.rb', line 20 def initialize(time:, anniversary:) @time = time @anniversary = anniversary end |
Instance Attribute Details
#anniversary ⇒ Object
Returns the value of attribute anniversary.
13 14 15 |
# File 'lib/timex_datalink_client/protocol_3/eeprom/anniversary.rb', line 13 def anniversary @anniversary end |
#time ⇒ Object
Returns the value of attribute time.
13 14 15 |
# File 'lib/timex_datalink_client/protocol_3/eeprom/anniversary.rb', line 13 def time @time end |
Instance Method Details
#packet ⇒ Array<Integer>
Compile a packet for an anniversary.
28 29 30 31 32 33 34 |
# File 'lib/timex_datalink_client/protocol_3/eeprom/anniversary.rb', line 28 def packet [ time.month, time.day, anniversary_characters ].flatten end |