Class: Navigable::Server::Response
- Inherits:
-
Object
- Object
- Navigable::Server::Response
- Defined in:
- lib/navigable/server/response.rb
Constant Summary collapse
- CONTENT_TYPE =
'Content-Type'
- CONTENT_LENGTH =
'Content-Length'
- MIME_TYPE_JSON =
'application/json'
- MIME_TYPE_HTML =
'text/html'
- MIME_TYPE_TEXT =
'text/plain'
- EMPTY_CONTENT =
''
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(params) ⇒ Response
constructor
A new instance of Response.
- #to_rack_response ⇒ Object
Constructor Details
#initialize(params) ⇒ Response
Returns a new instance of Response.
15 16 17 18 |
# File 'lib/navigable/server/response.rb', line 15 def initialize(params) @params = params @status = params[:status] || 200 end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
13 14 15 |
# File 'lib/navigable/server/response.rb', line 13 def params @params end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
13 14 15 |
# File 'lib/navigable/server/response.rb', line 13 def status @status end |
Instance Method Details
#to_rack_response ⇒ Object
20 21 22 |
# File 'lib/navigable/server/response.rb', line 20 def to_rack_response [status, headers, [content]] end |