Class: Webmachine::Adapters::Rack::RackResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/webmachine/adapters/rack.rb

Instance Method Summary collapse

Constructor Details

#initialize(body, status, headers) ⇒ RackResponse

Returns a new instance of RackResponse.



94
95
96
97
98
# File 'lib/webmachine/adapters/rack.rb', line 94

def initialize(body, status, headers)
  @body    = body
  @status  = status
  @headers = headers
end

Instance Method Details

#finishObject



100
101
102
103
104
# File 'lib/webmachine/adapters/rack.rb', line 100

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