Class: Wee::RedirectResponse

Inherits:
Response show all
Defined in:
lib/wee/response.rb

Constant Summary collapse

LOCATION_HEADER =
'Location'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(location) ⇒ RedirectResponse

Returns a new instance of RedirectResponse.



26
27
28
29
30
# File 'lib/wee/response.rb', line 26

def initialize(location)
  super(['<title>302 - Redirect</title><h1>302 - Redirect</h1>',
         '<p>You are being redirected to <a href="', location, '">', 
         location, '</a>'], 302, LOCATION_HEADER => location)
end