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



72
73
74
# File 'lib/action_dispatch/routing/redirection.rb', line 72

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

#path(params, request) ⇒ Object



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

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