Class: DripDrop::WebSocketHandler::Connection
- Inherits:
-
BaseHandler
- Object
- BaseHandler
- DripDrop::WebSocketHandler::Connection
- Defined in:
- lib/dripdrop/handlers/websockets.rb
Instance Attribute Summary collapse
-
#handler ⇒ Object
readonly
Returns the value of attribute handler.
-
#signature ⇒ Object
readonly
Returns the value of attribute signature.
-
#ws ⇒ Object
readonly
Returns the value of attribute ws.
Instance Method Summary collapse
-
#initialize(ws) ⇒ Connection
constructor
A new instance of Connection.
- #send_message(message) ⇒ Object
Methods inherited from BaseHandler
#handle_error, #on_error, #print_exception
Constructor Details
#initialize(ws) ⇒ Connection
Returns a new instance of Connection.
69 70 71 72 |
# File 'lib/dripdrop/handlers/websockets.rb', line 69 def initialize(ws) @ws = ws @signature = @ws.signature end |
Instance Attribute Details
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
67 68 69 |
# File 'lib/dripdrop/handlers/websockets.rb', line 67 def handler @handler end |
#signature ⇒ Object (readonly)
Returns the value of attribute signature.
67 68 69 |
# File 'lib/dripdrop/handlers/websockets.rb', line 67 def signature @signature end |
#ws ⇒ Object (readonly)
Returns the value of attribute ws.
67 68 69 |
# File 'lib/dripdrop/handlers/websockets.rb', line 67 def ws @ws end |
Instance Method Details
#send_message(message) ⇒ Object
74 75 76 77 |
# File 'lib/dripdrop/handlers/websockets.rb', line 74 def () = dd_messagify().encoded @ws.send() end |