Class: Thin::Connection
- Inherits:
-
Object
- Object
- Thin::Connection
- Defined in:
- lib/ruby/riddl/protocols/websocket.rb
Instance Attribute Summary collapse
-
#websocket ⇒ Object
Returns the value of attribute websocket.
Instance Method Summary collapse
- #pre_process_with_websocket ⇒ Object (also: #pre_process)
- #receive_data_with_websocket(data) ⇒ Object (also: #receive_data)
- #unbind_with_websocket ⇒ Object (also: #unbind)
- #websocket? ⇒ Boolean
Instance Attribute Details
#websocket ⇒ Object
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_websocket ⇒ Object 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_websocket ⇒ Object 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
8 9 10 |
# File 'lib/ruby/riddl/protocols/websocket.rb', line 8 def websocket? !self.websocket.nil? end |