Class: RackDispatch::RedirectHandler
- Inherits:
-
Object
- Object
- RackDispatch::RedirectHandler
- Defined in:
- lib/rack_dispatch/redirect_handler.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(path, status: 302) ⇒ RedirectHandler
constructor
A new instance of RedirectHandler.
Constructor Details
#initialize(path, status: 302) ⇒ RedirectHandler
Returns a new instance of RedirectHandler.
3 4 5 6 |
# File 'lib/rack_dispatch/redirect_handler.rb', line 3 def initialize(path, status: 302) @path = path @status = status end |
Instance Method Details
#call ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/rack_dispatch/redirect_handler.rb', line 8 def call [ @status, { 'Content-Type' => 'text/html', 'Location' => @path, }, ["Redirect to <a href=\"#@path\">#@path</a>"], ] end |