Class: RackDispatch::RedirectDestination

Inherits:
Object
  • Object
show all
Defined in:
lib/rack_dispatch/redirect_destination.rb

Instance Method Summary collapse

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