Class: TimexDatalinkClient::Protocol6::SoundScrollOptions
- Inherits:
-
Object
- Object
- TimexDatalinkClient::Protocol6::SoundScrollOptions
- Includes:
- ActiveModel::Validations, Helpers::CrcPacketsWrapper
- Defined in:
- lib/timex_datalink_client/protocol_6/sound_scroll_options.rb
Constant Summary collapse
- CPACKET_SOUND_SCROLL =
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.
-
#scroll_speed ⇒ Object
Returns the value of attribute scroll_speed.
Instance Method Summary collapse
- #button_beep_formatted ⇒ Object
- #hourly_chime_formatted ⇒ Object
-
#initialize(hourly_chime: false, button_beep: false, scroll_speed: 1) ⇒ SoundScrollOptions
constructor
Create a SoundScrollOptions instance.
-
#packets ⇒ Array<Array<Integer>>
Compile packets for sound and scroll options.
Constructor Details
#initialize(hourly_chime: false, button_beep: false, scroll_speed: 1) ⇒ SoundScrollOptions
Create a SoundScrollOptions instance.
26 27 28 29 30 |
# File 'lib/timex_datalink_client/protocol_6/sound_scroll_options.rb', line 26 def initialize(hourly_chime: false, button_beep: false, scroll_speed: 1) @hourly_chime = hourly_chime @button_beep = @scroll_speed = scroll_speed end |
Instance Attribute Details
#button_beep ⇒ Object
Returns the value of attribute button_beep.
18 19 20 |
# File 'lib/timex_datalink_client/protocol_6/sound_scroll_options.rb', line 18 def @button_beep end |
#hourly_chime ⇒ Object
Returns the value of attribute hourly_chime.
18 19 20 |
# File 'lib/timex_datalink_client/protocol_6/sound_scroll_options.rb', line 18 def hourly_chime @hourly_chime end |
#scroll_speed ⇒ Object
Returns the value of attribute scroll_speed.
18 19 20 |
# File 'lib/timex_datalink_client/protocol_6/sound_scroll_options.rb', line 18 def scroll_speed @scroll_speed end |
Instance Method Details
#button_beep_formatted ⇒ Object
53 54 55 |
# File 'lib/timex_datalink_client/protocol_6/sound_scroll_options.rb', line 53 def ? 1 : 0 end |
#hourly_chime_formatted ⇒ Object
49 50 51 |
# File 'lib/timex_datalink_client/protocol_6/sound_scroll_options.rb', line 49 def hourly_chime_formatted hourly_chime ? 1 : 0 end |
#packets ⇒ Array<Array<Integer>>
Compile packets for sound and scroll options.
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/timex_datalink_client/protocol_6/sound_scroll_options.rb', line 36 def packets validate! [ [ CPACKET_SOUND_SCROLL, hourly_chime_formatted, , scroll_speed ] ] end |