Class: Lignite::SystemReply
Overview
A reply to a SystemCommand
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#msgid ⇒ Object
readonly
Returns the value of attribute msgid.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Attributes inherited from Message
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(msgid:, error:, body:) ⇒ SystemReply
constructor
A new instance of SystemReply.
Methods inherited from Message
#bytes, direct_command_no_reply, direct_command_with_reply, msgid, reply_from_bytes, reset_msgid, system_command_no_reply, system_command_with_reply
Methods included from Bytes
#bin_to_hex, #f32, #hex_to_bin, #u16, #u32, #u8, #unpack_f32, #unpack_u16, #unpack_u32, #unpack_u8
Methods included from Logger
Constructor Details
#initialize(msgid:, error:, body:) ⇒ SystemReply
Returns a new instance of SystemReply.
76 77 78 79 80 81 82 |
# File 'lib/lignite/message.rb', line 76 def initialize(msgid:, error:, body:) @msgid = msgid @error = error @command = unpack_u8(body[0]) @status = unpack_u8(body[1]) @data = body[2..-1] end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
84 85 86 |
# File 'lib/lignite/message.rb', line 84 def command @command end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
84 85 86 |
# File 'lib/lignite/message.rb', line 84 def data @data end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
84 85 86 |
# File 'lib/lignite/message.rb', line 84 def error @error end |
#msgid ⇒ Object (readonly)
Returns the value of attribute msgid.
84 85 86 |
# File 'lib/lignite/message.rb', line 84 def msgid @msgid end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
84 85 86 |
# File 'lib/lignite/message.rb', line 84 def status @status end |
Instance Method Details
#error? ⇒ Boolean
86 87 88 |
# File 'lib/lignite/message.rb', line 86 def error? @error end |