Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
URI::Generic#route_to
route_to(oth)
lib/uri/generic.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/uri/generic.rb, line 1302
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>