Class: Dolphy::Response
- Inherits:
-
Object
- Object
- Dolphy::Response
- Defined in:
- lib/dolphy/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize(status = 200, headers = {"Content-type" => "text/html"}) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(status = 200, headers = {"Content-type" => "text/html"}) ⇒ Response
5 6 7 8 9 10 |
# File 'lib/dolphy/response.rb', line 5 def initialize(status = 200, headers = {"Content-type" => "text/html"}) @status = status @headers = headers @body = [] end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
3 4 5 |
# File 'lib/dolphy/response.rb', line 3 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers.
3 4 5 |
# File 'lib/dolphy/response.rb', line 3 def headers @headers end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/dolphy/response.rb', line 3 def status @status end |
Instance Method Details
#finish ⇒ Object
12 13 14 |
# File 'lib/dolphy/response.rb', line 12 def finish [status, headers, body] end |