Class: Net::SSH::Telnet::TinyFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/netsshtelnet.rb

Overview

Wrapper to emulate the behaviour of Net::Telnet “Proxy” option, where the user passes in an already-open socket

Instance Method Summary collapse

Constructor Details

#initialize(sock) ⇒ TinyFactory

Returns a new instance of TinyFactory.



27
28
29
# File 'lib/netsshtelnet.rb', line 27

def initialize(sock)
  @sock = sock
end

Instance Method Details

#open(host, port) ⇒ Object



30
31
32
33
34
# File 'lib/netsshtelnet.rb', line 30

def open(host, port)
  s = @sock
  @sock = nil
  s
end