Sha256: dcc5b5f762ecb7dc510eaf07350b1222b4740ab3293f646d74493f3cfc20a6aa
Contents?: true
Size: 417 Bytes
Versions: 11
Compression:
Stored size: 417 Bytes
Contents
class Usher class Route # add("/index.html").redirect("/") def redirect(path, status = 302) unless (300..399).include?(status) raise ArgumentError, "Status has to be an integer between 300 and 399" end @destination = lambda do |env| response = Rack::Response.new response.redirect(path, status) response.finish end return self end end end
Version data entries
11 entries across 11 versions & 1 rubygems