Class: RackDispatch::RedirectDestination
- Inherits:
-
Object
- Object
- RackDispatch::RedirectDestination
- Defined in:
- lib/rack_dispatch/redirect_destination.rb
Instance Method Summary collapse
- #call(request, response) ⇒ Object
-
#initialize(path, status: 302) ⇒ RedirectDestination
constructor
A new instance of RedirectDestination.
Constructor Details
#initialize(path, status: 302) ⇒ RedirectDestination
Returns a new instance of RedirectDestination.
3 4 5 6 |
# File 'lib/rack_dispatch/redirect_destination.rb', line 3 def initialize(path, status: 302) @path = path @status = status end |
Instance Method Details
#call(request, response) ⇒ Object
8 9 10 |
# File 'lib/rack_dispatch/redirect_destination.rb', line 8 def call(request, response) response.redirect(@path, @status) end |