The response object. See Rack::Response and Rack::ResponseHelpers for more info: rack.rubyforge.org/doc/classes/Rack/Response.html rack.rubyforge.org/doc/classes/Rack/Response/Helpers.html
# File lib/sinatra/base.rb, line 66 def initialize(*) super headers['Content-Type'] ||= 'text/html' end
# File lib/sinatra/base.rb, line 71 def body=(value) value = value.body while Rack::Response === value @body = String === value ? [value.to_str] : value end
# File lib/sinatra/base.rb, line 76 def each block_given? ? super : enum_for(:each) end
# File lib/sinatra/base.rb, line 80 def finish result = body if drop_content_info? headers.delete "Content-Length" headers.delete "Content-Type" end if drop_body? close result = [] end if calculate_content_length? # if some other code has already set Content-Length, don't muck with it # currently, this would be the static file-handler headers["Content-Length"] = body.inject(0) { |l, p| l + Rack::Utils.bytesize(p) }.to_s end [status.to_i, headers, result] end