Class: Wee::RedirectResponse

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

Constant Summary

Constants inherited from GenericResponse

GenericResponse::EXPIRE_OFFSET

Constants inherited from Response

Wee::Response::DEFAULT_HEADER

Instance Attribute Summary

Attributes inherited from Response

#content, #header, #status

Instance Method Summary collapse

Methods inherited from Response

#<<, #content_type, #content_type=, #cookies, #cookies?

Constructor Details

#initialize(location) ⇒ RedirectResponse

Returns a new instance of RedirectResponse.



50
51
52
53
54
# File 'lib/wee/response.rb', line 50

def initialize(location)
  super('text/html', %[<title>302 - Redirect</title><h1>302 - Redirect</h1><p>You are being redirected to <a href="#{location}">#{location}</a>])
  @status = 302
  @header['Location'] = location
end