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

Inherits:
Object
  • Object
show all
Defined in:
lib/net/ssh/telnet.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.



22
23
24
# File 'lib/net/ssh/telnet.rb', line 22

def initialize(sock)
  @sock = sock
end

Instance Method Details

#open(host, port) ⇒ Object



25
26
27
28
29
# File 'lib/net/ssh/telnet.rb', line 25

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