class ActionDispatch::Routing::OptionRedirect

:nodoc:

def escape_path(params)

def escape_path(params)
  Hash[params.map{ |k,v| [k, URI.parser.escape(v)] }]
end

def inspect

def inspect
  "redirect(#{status}, #{options.map{ |k,v| "#{k}: #{v}" }.join(', ')})"
end

def path(params, request)

def path(params, request)
  url_options = {
    :protocol => request.protocol,
    :host     => request.host,
    :port     => request.optional_port,
    :path     => request.path,
    :params   => request.query_parameters
  }.merge! options
  if !params.empty? && url_options[:path].match(/%\{\w*\}/)
    url_options[:path] = (url_options[:path] % escape_path(params))
  end
  if relative_path?(url_options[:path])
    url_options[:path] = "/#{url_options[:path]}"
    url_options[:script_name] = request.script_name
  end
  ActionDispatch::Http::URL.url_for url_options
end