Class: TimexDatalinkClient::Protocol9::Timer
- Inherits:
-
Object
- Object
- TimexDatalinkClient::Protocol9::Timer
- Includes:
- Helpers::CharEncoders, Helpers::CrcPacketsWrapper
- Defined in:
- lib/timex_datalink_client/protocol_9/timer.rb
Constant Summary collapse
- CPACKET_TIMER =
[0x43]
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
-
#action_at_end ⇒ Object
Returns the value of attribute action_at_end.
-
#label ⇒ Object
Returns the value of attribute label.
-
#number ⇒ Object
Returns the value of attribute number.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(number:, label:, time:, action_at_end:) ⇒ Timer
constructor
Create a Timer instance.
-
#packets ⇒ Array<Array<Integer>>
Compile packets for a timer.
Methods included from Helpers::CharEncoders
#chars_for, #eeprom_chars_for, #phone_chars_for
Constructor Details
#initialize(number:, label:, time:, action_at_end:) ⇒ Timer
Create a Timer instance.
23 24 25 26 27 28 |
# File 'lib/timex_datalink_client/protocol_9/timer.rb', line 23 def initialize(number:, label:, time:, action_at_end:) @number = number @label = label @time = time @action_at_end = action_at_end end |
Instance Attribute Details
#action_at_end ⇒ Object
Returns the value of attribute action_at_end.
14 15 16 |
# File 'lib/timex_datalink_client/protocol_9/timer.rb', line 14 def action_at_end @action_at_end end |
#label ⇒ Object
Returns the value of attribute label.
14 15 16 |
# File 'lib/timex_datalink_client/protocol_9/timer.rb', line 14 def label @label end |
#number ⇒ Object
Returns the value of attribute number.
14 15 16 |
# File 'lib/timex_datalink_client/protocol_9/timer.rb', line 14 def number @number end |
#time ⇒ Object
Returns the value of attribute time.
14 15 16 |
# File 'lib/timex_datalink_client/protocol_9/timer.rb', line 14 def time @time end |
Instance Method Details
#packets ⇒ Array<Array<Integer>>
Compile packets for a timer.
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/timex_datalink_client/protocol_9/timer.rb', line 33 def packets [ [ CPACKET_TIMER, number, time.hour, time.min, time.sec, action_at_end, label_characters ].flatten ] end |