Class: Tansu::Response

Inherits:
Rack::Response
  • Object
show all
Defined in:
lib/tansu/response.rb

Instance Method Summary collapse

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

#finishObject



9
10
11
12
13
14
15
16
17
# File 'lib/tansu/response.rb', line 9

def finish
   if 

  ret = drop_body? ? drop_body : body

  headers['Content-Length'] = content_length.to_s if need_content_length?

  [status.to_i, headers, ret]
end