Class: EventMachine::Response
- Inherits:
-
Object
- Object
- EventMachine::Response
- Defined in:
- lib/appbooster-server/response.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #content_type(type) ⇒ Object
-
#initialize ⇒ Response
constructor
A new instance of Response.
- #send_response ⇒ Object
Constructor Details
#initialize ⇒ Response
Returns a new instance of Response.
8 9 10 |
# File 'lib/appbooster-server/response.rb', line 8 def initialize @headers = {} end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
6 7 8 |
# File 'lib/appbooster-server/response.rb', line 6 def content @content end |
#headers ⇒ Object
Returns the value of attribute headers.
6 7 8 |
# File 'lib/appbooster-server/response.rb', line 6 def headers @headers end |
#status ⇒ Object
Returns the value of attribute status.
6 7 8 |
# File 'lib/appbooster-server/response.rb', line 6 def status @status end |
Instance Method Details
#content_type(type) ⇒ Object
18 19 20 |
# File 'lib/appbooster-server/response.rb', line 18 def content_type type @headers["Content-type"] = type || 'text/plain' end |
#send_response ⇒ Object
12 13 14 15 16 |
# File 'lib/appbooster-server/response.rb', line 12 def send_response send_headers send_body close_connection_after_writing end |