Method: Addressable::URI#route_to

Defined in:
lib/addressable/uri.rb

#route_to(uri) ⇒ Addressable::URI

Returns the shortest normalized relative form of the supplied URI that uses this URI as a base for resolution. Returns an absolute URI if necessary. This is effectively the opposite of route_from.

Parameters:

Returns:

  • (Addressable::URI)

    The normalized relative URI that is equivalent to the supplied URI.



2139
2140
2141
# File 'lib/addressable/uri.rb', line 2139

def route_to(uri)
  return URI.parse(uri).route_from(self)
end