Class: RTunnel::GenerateSessionKeyCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/rtunnel/commands.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Command

command_code, decode, printable_codes, registry, #to_encoded_str

Constructor Details

#initialize(public_key_fp = nil) ⇒ GenerateSessionKeyCommand

Returns a new instance of GenerateSessionKeyCommand.



186
187
188
189
# File 'lib/rtunnel/commands.rb', line 186

def initialize(public_key_fp = nil)
  super()
  @public_key_fp = public_key_fp
end

Instance Attribute Details

#public_key_fpObject (readonly)

Returns the value of attribute public_key_fp.



184
185
186
# File 'lib/rtunnel/commands.rb', line 184

def public_key_fp
  @public_key_fp
end

Instance Method Details

#encode(io) ⇒ Object



201
202
203
204
# File 'lib/rtunnel/commands.rb', line 201

def encode(io)
  super
  io.write_varstring @public_key_fp
end

#initialize_from_io(io) ⇒ Object



195
196
197
198
199
# File 'lib/rtunnel/commands.rb', line 195

def initialize_from_io(io)
  super
  @public_key_fp = io.read_varstring
  self    
end

#to_sObject



191
192
193
# File 'lib/rtunnel/commands.rb', line 191

def to_s
  super + "/pubkey_fp=#{@public_key_fp.inspect}"
end