module Irrc::Connecting

Private Instance Methods

close() click to toggle source
# File lib/irrc/connecting.rb, line 21
def close
  if established?
    logger.info "Closing a connection to #{@fqdn}"
    @connection.close
  end
end
connect() click to toggle source
# File lib/irrc/connecting.rb, line 13
def connect
  @connection ||= logger.info("Connecting to #{@fqdn}") &&
    Net::Telnet.new('Host' => @fqdn,
    'Port' => 43,
    'Telnetmode' => false,
    'Prompt' => return_code)
end
connection() click to toggle source
# File lib/irrc/connecting.rb, line 5
def connection
  @connection
end
connection=(connection) click to toggle source
# File lib/irrc/connecting.rb, line 9
def connection=(connection)
  @connection = connection
end
established?() click to toggle source
# File lib/irrc/connecting.rb, line 28
def established?
  @connection && !@connection.sock.closed?
end