Class: Thin::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby/riddl/protocols/websocket.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#websocketObject

Returns the value of attribute websocket.



7
8
9
# File 'lib/ruby/riddl/protocols/websocket.rb', line 7

def websocket
  @websocket
end

Instance Method Details

#pre_process_with_websocketObject Also known as: pre_process



12
13
14
15
# File 'lib/ruby/riddl/protocols/websocket.rb', line 12

def pre_process_with_websocket
  @request.env['thin.connection'] = self
  pre_process_without_websocket
end

#receive_data_with_websocket(data) ⇒ Object Also known as: receive_data



19
20
21
22
23
24
25
# File 'lib/ruby/riddl/protocols/websocket.rb', line 19

def receive_data_with_websocket(data)
  if self.websocket?
    self.websocket.receive_data(data)
  else
    receive_data_without_websocket(data)
  end
end

#unbind_with_websocketObject Also known as: unbind



29
30
31
32
33
34
35
# File 'lib/ruby/riddl/protocols/websocket.rb', line 29

def unbind_with_websocket
  if self.websocket?
    self.websocket.unbind
  else
    unbind_without_websocket
  end
end

#websocket?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/ruby/riddl/protocols/websocket.rb', line 8

def websocket?
  !self.websocket.nil?
end