Class: MovingsignApi::SetSoundCommand
- Inherits:
-
WriteControlCommand
- Object
- Command
- WriteControlCommand
- MovingsignApi::SetSoundCommand
- Defined in:
- lib/movingsign_api/commands/set_sound_command.rb
Overview
Sets the sound on/off property of the sign
Instance Attribute Summary collapse
-
#on ⇒ Object
Returns the value of attribute on.
Attributes inherited from Command
Instance Method Summary collapse
-
#initialize(sound_on) ⇒ SetSoundCommand
constructor
A new instance of SetSoundCommand.
- #subcommand_code ⇒ Object
- #subcommand_payload_bytes ⇒ Object
Methods inherited from WriteControlCommand
Methods inherited from Command
Constructor Details
#initialize(sound_on) ⇒ SetSoundCommand
Returns a new instance of SetSoundCommand.
9 10 11 |
# File 'lib/movingsign_api/commands/set_sound_command.rb', line 9 def initialize(sound_on) @on = sound_on end |
Instance Attribute Details
#on ⇒ Object
Returns the value of attribute on.
6 7 8 |
# File 'lib/movingsign_api/commands/set_sound_command.rb', line 6 def on @on end |
Instance Method Details
#subcommand_code ⇒ Object
13 14 15 |
# File 'lib/movingsign_api/commands/set_sound_command.rb', line 13 def subcommand_code 'J' end |
#subcommand_payload_bytes ⇒ Object
17 18 19 |
# File 'lib/movingsign_api/commands/set_sound_command.rb', line 17 def subcommand_payload_bytes string_to_ascii_bytes(@on ? '1' : '0') end |