Class: TimexDatalinkClient::Protocol4::SoundOptions
- Inherits:
-
Object
- Object
- TimexDatalinkClient::Protocol4::SoundOptions
- Includes:
- Helpers::CrcPacketsWrapper
- Defined in:
- lib/timex_datalink_client/protocol_4/sound_options.rb
Constant Summary collapse
- CPACKET_BEEPS =
[0x71]
Instance Attribute Summary collapse
-
#button_beep ⇒ Object
Returns the value of attribute button_beep.
-
#hourly_chime ⇒ Object
Returns the value of attribute hourly_chime.
Instance Method Summary collapse
- #button_beep_integer ⇒ Object
- #hourly_chime_integer ⇒ Object
-
#initialize(hourly_chime:, button_beep:) ⇒ SoundOptions
constructor
Create a SoundOptions instance.
-
#packets ⇒ Array<Array<Integer>>
Compile packets for sound options.
Constructor Details
#initialize(hourly_chime:, button_beep:) ⇒ SoundOptions
Create a SoundOptions instance.
19 20 21 22 |
# File 'lib/timex_datalink_client/protocol_4/sound_options.rb', line 19 def initialize(hourly_chime:, button_beep:) @hourly_chime = hourly_chime @button_beep = end |
Instance Attribute Details
#button_beep ⇒ Object
Returns the value of attribute button_beep.
12 13 14 |
# File 'lib/timex_datalink_client/protocol_4/sound_options.rb', line 12 def @button_beep end |
#hourly_chime ⇒ Object
Returns the value of attribute hourly_chime.
12 13 14 |
# File 'lib/timex_datalink_client/protocol_4/sound_options.rb', line 12 def hourly_chime @hourly_chime end |
Instance Method Details
#button_beep_integer ⇒ Object
37 38 39 |
# File 'lib/timex_datalink_client/protocol_4/sound_options.rb', line 37 def ? 1 : 0 end |
#hourly_chime_integer ⇒ Object
33 34 35 |
# File 'lib/timex_datalink_client/protocol_4/sound_options.rb', line 33 def hourly_chime_integer hourly_chime ? 1 : 0 end |
#packets ⇒ Array<Array<Integer>>
Compile packets for sound options.
27 28 29 30 31 |
# File 'lib/timex_datalink_client/protocol_4/sound_options.rb', line 27 def packets [ CPACKET_BEEPS + [hourly_chime_integer, ] ] end |