class Webmachine::Adapters::Rack::RackResponse

Constants

ONE_FIVE

Public Class Methods

new(body, status, headers) click to toggle source
# File lib/webmachine/adapters/rack.rb, line 132
def initialize(body, status, headers)
  @body = body
  @status = status
  @headers = headers
end

Public Instance Methods

finish() click to toggle source
# File lib/webmachine/adapters/rack.rb, line 138
def finish
  @headers[CONTENT_TYPE] ||= TEXT_HTML if rack_release_enforcing_content_type
  @headers.delete(CONTENT_TYPE) if response_without_body
  [@status, @headers, @body]
end

Protected Instance Methods

rack_release_enforcing_content_type() click to toggle source
# File lib/webmachine/adapters/rack.rb, line 150
def rack_release_enforcing_content_type
  ::Rack.release < ONE_FIVE
end
response_without_body() click to toggle source
# File lib/webmachine/adapters/rack.rb, line 146
def response_without_body
  ::Rack::Utils::STATUS_WITH_NO_ENTITY_BODY.include? @status
end