Class: Tansu::Response
- Inherits:
-
Rack::Response
- Object
- Rack::Response
- Tansu::Response
- Defined in:
- lib/tansu/response.rb
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize(body = [], status = 200, header = {}) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(body = [], status = 200, header = {}) ⇒ Response
Returns a new instance of Response.
3 4 5 6 7 |
# File 'lib/tansu/response.rb', line 3 def initialize(body = [], status = 200, header = {}) super body, status, header headers['Content-Type'] ||= 'text/html' end |
Instance Method Details
#finish ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/tansu/response.rb', line 9 def finish drop_content_info if drop_content_info? ret = drop_body? ? drop_body : body headers['Content-Length'] = content_length.to_s if need_content_length? [status.to_i, headers, ret] end |