class MovingsignApi::WriteControlCommand
Write control command base class, subclassed by actual implementations
In subclasses, be sure to implement:
-
{#subcommand_code}
-
{#subcommand_payload_bytes}
Public Instance Methods
command_code()
click to toggle source
# File lib/movingsign_api/commands/write_control_command.rb, line 10 def command_code 'W' end
subcommand_code()
click to toggle source
# File lib/movingsign_api/commands/write_control_command.rb, line 14 def subcommand_code raise MovingsignApi::NotImplementedError, "Needs to be implemented in subclass." end
Private Instance Methods
command_payload_bytes()
click to toggle source
# File lib/movingsign_api/commands/write_control_command.rb, line 20 def command_payload_bytes bytes = [] bytes.concat string_to_ascii_bytes subcommand_code bytes.concat subcommand_payload_bytes bytes end
subcommand_payload_bytes()
click to toggle source
generates control sub-command specific bytes
# File lib/movingsign_api/commands/write_control_command.rb, line 30 def subcommand_payload_bytes raise MovingsignApi::NotImplementedError, "Needs to be implemented in subclass." end