Class: StartProgram
- Inherits:
-
DirectCommand
- Object
- Telegram
- RespondableTelegram
- DirectCommand
- StartProgram
- Includes:
- MessageTranslator
- Defined in:
- lib/telegrams/commands/direct/start_program.rb
Constant Summary
Constants included from MessageTranslator
MessageTranslator::FILENAME_MAX_LENGTH
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from RespondableTelegram
Attributes inherited from Telegram
Instance Method Summary collapse
- #as_bytes ⇒ Object
-
#initialize(program_name, require_response = true) ⇒ StartProgram
constructor
A new instance of StartProgram.
Methods included from MessageTranslator
#add_default_extension_if_missing, #boolean_as_bytes, #boolean_from_bytes, #integer_as_bytes, #integer_as_ulong_bytes, #integer_as_uword_bytes, #integer_from_bytes, #string_as_bytes, #string_from_bytes
Methods inherited from RespondableTelegram
#require_response=, #require_response?
Methods inherited from Telegram
Constructor Details
#initialize(program_name, require_response = true) ⇒ StartProgram
Returns a new instance of StartProgram.
9 10 11 12 13 14 15 |
# File 'lib/telegrams/commands/direct/start_program.rb', line 9 def initialize(program_name, require_response=true) raise ArgumentError, "program_name is required" if program_name.nil? super(require_response) @command = 0x00 # startprogram @name = adjust_program_name(program_name) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/telegrams/commands/direct/start_program.rb', line 7 def name @name end |
Instance Method Details
#as_bytes ⇒ Object
17 18 19 20 |
# File 'lib/telegrams/commands/direct/start_program.rb', line 17 def as_bytes bytes = super bytes.concat program_name_as_bytes end |