Class: DripDrop::WebSocketHandler::Connection
- Inherits:
-
BaseHandler
- Object
- BaseHandler
- DripDrop::WebSocketHandler::Connection
- Defined in:
- lib/dripdrop/handlers/websocket_server.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.
77 78 79 80 |
# File 'lib/dripdrop/handlers/websocket_server.rb', line 77 def initialize(ws) @ws = ws @signature = @ws.signature end |
Instance Attribute Details
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
75 76 77 |
# File 'lib/dripdrop/handlers/websocket_server.rb', line 75 def handler @handler end |
#signature ⇒ Object (readonly)
Returns the value of attribute signature.
75 76 77 |
# File 'lib/dripdrop/handlers/websocket_server.rb', line 75 def signature @signature end |
#ws ⇒ Object (readonly)
Returns the value of attribute ws.
75 76 77 |
# File 'lib/dripdrop/handlers/websocket_server.rb', line 75 def ws @ws end |
Instance Method Details
#send_message(message) ⇒ Object
82 83 84 85 86 87 88 89 |
# File 'lib/dripdrop/handlers/websocket_server.rb', line 82 def () begin = dd_messagify().encoded @ws.send() rescue StandardError => e handle_error(e) end end |