Class: DripDrop::HTTPServerHandlerResponse
- Inherits:
-
BaseHandler
- Object
- BaseHandler
- DripDrop::HTTPServerHandlerResponse
- Defined in:
- lib/dripdrop/handlers/http_server.rb
Instance Attribute Summary collapse
-
#em_response ⇒ Object
readonly
Returns the value of attribute em_response.
-
#message_class ⇒ Object
readonly
Returns the value of attribute message_class.
Instance Method Summary collapse
-
#initialize(em_response) ⇒ HTTPServerHandlerResponse
constructor
A new instance of HTTPServerHandlerResponse.
- #send_message(message) ⇒ Object
Methods inherited from BaseHandler
#handle_error, #on_error, #print_exception
Constructor Details
#initialize(em_response) ⇒ HTTPServerHandlerResponse
Returns a new instance of HTTPServerHandlerResponse.
6 7 8 |
# File 'lib/dripdrop/handlers/http_server.rb', line 6 def initialize(em_response) @em_response = em_response end |
Instance Attribute Details
#em_response ⇒ Object (readonly)
Returns the value of attribute em_response.
5 6 7 |
# File 'lib/dripdrop/handlers/http_server.rb', line 5 def em_response @em_response end |
#message_class ⇒ Object (readonly)
Returns the value of attribute message_class.
5 6 7 |
# File 'lib/dripdrop/handlers/http_server.rb', line 5 def @message_class end |
Instance Method Details
#send_message(message) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/dripdrop/handlers/http_server.rb', line 10 def () = dd_messagify() @em_response.status = 200 @em_response.content = .json_encoded @em_response.send_response end |