Class: Wee::RefreshResponse

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

Instance Method Summary collapse

Constructor Details

#initialize(message, location, seconds = 5) ⇒ RefreshResponse

Returns a new instance of RefreshResponse.



31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/wee/response.rb', line 31

def initialize(message, location, seconds=5)
  super([%[<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> 
      in #{seconds} seconds.
    </body>
    </html>]])
end