End of Life Ruby 3.1 has reached end of life and gets no more fixes. 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.1.3/lib/uri/generic.rb, line 1292
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>