Class: Wee::RefreshResponse

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(message, location, seconds = 10) ⇒ RefreshResponse

Returns a new instance of RefreshResponse.



58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/wee/response.rb', line 58

def initialize(message, location, seconds=10)
  super('text/html', %[<html>
    <head>
      <meta http-equiv="REFRESH" content="#{seconds};URL=#{location}">
      <title>#{message}</title>
    </head>
    <body>
      <h1>#{message}</h1>
      You are being redirected to <a href="#{location}">#{location}</a>
    </body>
    </html>])
end