Class: Cocaine::Http::Response
Instance Method Summary collapse
- #body=(body) ⇒ Object
- #close ⇒ Object
- #error(errno, reason) ⇒ Object
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
- #write_headers(code, headers) ⇒ Object
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
33 34 35 |
# File 'lib/cocaine/server/http.rb', line 33 def initialize(response) @response = response end |
Instance Method Details
#body=(body) ⇒ Object
41 42 43 |
# File 'lib/cocaine/server/http.rb', line 41 def body=(body) @response.write body end |
#close ⇒ Object
49 50 51 |
# File 'lib/cocaine/server/http.rb', line 49 def close @response.close end |
#error(errno, reason) ⇒ Object
45 46 47 |
# File 'lib/cocaine/server/http.rb', line 45 def error(errno, reason) @response.error errno, reason end |
#write_headers(code, headers) ⇒ Object
37 38 39 |
# File 'lib/cocaine/server/http.rb', line 37 def write_headers(code, headers) @response.write [code, headers] end |