Class: RTunnel::SendDataCommand
- Inherits:
-
ConnectionCommand
- Object
- Command
- ConnectionCommand
- RTunnel::SendDataCommand
- Defined in:
- lib/rtunnel/commands.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Attributes inherited from ConnectionCommand
Instance Method Summary collapse
- #encode(io) ⇒ Object
-
#initialize(connection_id = nil, data = nil) ⇒ SendDataCommand
constructor
A new instance of SendDataCommand.
- #initialize_from_io(io) ⇒ Object
- #to_s ⇒ Object
Methods inherited from Command
command_code, decode, printable_codes, registry, #to_encoded_str
Constructor Details
#initialize(connection_id = nil, data = nil) ⇒ SendDataCommand
Returns a new instance of SendDataCommand.
126 127 128 129 |
# File 'lib/rtunnel/commands.rb', line 126 def initialize(connection_id = nil, data = nil) super(connection_id) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
124 125 126 |
# File 'lib/rtunnel/commands.rb', line 124 def data @data end |
Instance Method Details
#encode(io) ⇒ Object
141 142 143 144 |
# File 'lib/rtunnel/commands.rb', line 141 def encode(io) super io.write_varstring @data end |
#initialize_from_io(io) ⇒ Object
131 132 133 134 135 |
# File 'lib/rtunnel/commands.rb', line 131 def initialize_from_io(io) super @data = io.read_varstring self end |
#to_s ⇒ Object
137 138 139 |
# File 'lib/rtunnel/commands.rb', line 137 def to_s super + "/data=#{data}" end |