Class: RTunnel::ConnectionCommand
- Defined in:
- lib/rtunnel/commands.rb
Direct Known Subclasses
CloseConnectionCommand, CreateConnectionCommand, SendDataCommand
Instance Attribute Summary collapse
-
#connection_id ⇒ Object
readonly
Returns the value of attribute connection_id.
Instance Method Summary collapse
- #encode(io) ⇒ Object
-
#initialize(connection_id = nil) ⇒ ConnectionCommand
constructor
A new instance of ConnectionCommand.
- #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) ⇒ ConnectionCommand
Returns a new instance of ConnectionCommand.
92 93 94 95 |
# File 'lib/rtunnel/commands.rb', line 92 def initialize(connection_id = nil) super() @connection_id = connection_id end |
Instance Attribute Details
#connection_id ⇒ Object (readonly)
Returns the value of attribute connection_id.
90 91 92 |
# File 'lib/rtunnel/commands.rb', line 90 def connection_id @connection_id end |
Instance Method Details
#encode(io) ⇒ Object
107 108 109 110 |
# File 'lib/rtunnel/commands.rb', line 107 def encode(io) super io.write_varstring @connection_id end |
#initialize_from_io(io) ⇒ Object
101 102 103 104 105 |
# File 'lib/rtunnel/commands.rb', line 101 def initialize_from_io(io) super @connection_id = io.read_varstring self end |
#to_s ⇒ Object
97 98 99 |
# File 'lib/rtunnel/commands.rb', line 97 def to_s super + "/id=#{connection_id}" end |