Class: WebSocket::Client

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

Overview

The WebSocket::Client class

Instance Method Summary collapse

Methods included from Listenable

#add_listener, #listeners, #notify, #remove_listener, #replace_listeners

Methods included from ClientInstanceMethods

#channelActive, #channelInactive, #client_has_shut_down, #close, #connect, #execute_command, #gets, #invoke_user_app, #messageReceived, #ping, #puts, #read_user_commands, #session, #shut_down_callbacks, #shutdown, #when_client_has_shut_down

Methods included from ClientInitializationMethods

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

Constructor Details

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

Returns a new instance of Client.



428
429
430
431
432
433
# File 'lib/websocket_client.rb', line 428

def initialize(options = {}, &block)
  init(::WebSocket.client_config.merge(options))
  configure_handlers(&block)
  connect
  session
end

Instance Method Details

#to_sObject Also known as: inspect



435
436
437
# File 'lib/websocket_client.rb', line 435

def to_s
  format('#<%<class>s:0x%<id>s>', class: self.class.name, id: object_id.to_s(16))
end