Class: ActionDispatch::Routing::PathRedirect

Inherits:
Redirect
  • Object
show all
Defined in:
lib/action_dispatch/routing/redirection.rb

Instance Attribute Summary

Attributes inherited from Redirect

#block, #status

Instance Method Summary collapse

Methods inherited from Redirect

#call, #initialize

Constructor Details

This class inherits a constructor from ActionDispatch::Routing::Redirect

Instance Method Details

#inspectObject


67
68
69
# File 'lib/action_dispatch/routing/redirection.rb', line 67

def inspect
  "redirect(#{status}, #{block})"
end

#path(params, request) ⇒ Object


63
64
65
# File 'lib/action_dispatch/routing/redirection.rb', line 63

def path(params, request)
  (params.empty? || !block.match(/%\{\w*\}/)) ? block : (block % escape(params))
end