Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
URI::Generic#route_to
(::String oth) -> ::URI::Generic
route_to(oth)
lib/uri/generic.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/uri/generic.rb, line 1326
def route_to(oth)
parser.__send__(:convert_to_uri, oth).route_from(self)
end
Args
Description
Calculates relative path to oth from self.
Usage
Example
require 'uri' uri = URI.parse('http://my.example.com') uri.route_to('http://my.example.com/main.rbx?page=1') #=> #<URI::Generic /main.rbx?page=1>