Class: Telnet::Client

Inherits:
Object show all
Includes:
ClientInitializationMethods, ClientInstanceMethods, Listenable
Defined in:
lib/telnet_client.rb

Overview

The Telnet::Client class

Constant Summary collapse

IdentiferTemplate =
'#<%<class>s:0x%<id>s>'.freeze

Instance Method Summary collapse

Methods included from Listenable

#add_listener, #listeners, #notify, #remove_listener

Methods included from ClientInstanceMethods

#channel_active, #channel_inactive, #channel_unregistered, #client_has_shut_down, #close, #connect, #execute_command, #gets, #invoke_user_app, #message_received, #puts, #read_user_commands, #session, #shut_down_callbacks, #shutdown, #wait_until_channel_is_active, #when_client_has_shut_down

Methods included from ClientInitializationMethods

#bootstrap, #channel_initializer, #client_group, #configure_handlers, #init, #logging_handler

Constructor Details

#initialize(params = {}, &block) ⇒ Client

Returns a new instance of Client.



402
403
404
405
406
407
# File 'lib/telnet_client.rb', line 402

def initialize(params = {}, &block)
  init(::Telnet.client_config.merge(params.fetch(:options, {})))
  configure_handlers(params.fetch(:handlers, []), &block)
  connect
  session
end

Instance Method Details

#to_sObject Also known as: inspect



411
412
413
# File 'lib/telnet_client.rb', line 411

def to_s
  format(IdentiferTemplate, class: self.class.name, id: object_id.to_s(16))
end