Class: Async::WebSocket::Client::ClientCloseDecorator

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/async/websocket/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(client, connection) ⇒ ClientCloseDecorator

Returns a new instance of ClientCloseDecorator.



40
41
42
43
# File 'lib/async/websocket/client.rb', line 40

def initialize(client, connection)
  @client = client
  super(connection)
end

Instance Method Details

#closeObject



45
46
47
48
49
50
51
52
# File 'lib/async/websocket/client.rb', line 45

def close(...)
  super(...)
  
  if @client
    @client.close
    @client = nil
  end
end