public Method

Generic.route_to(oth)

Args

oth:URI or String

Description

Calculates relative path to oth from self

Usage

require 'uri'

uri = URI.parse('http://my.example.com')
p uri.route_to('http://my.example.com/main.rbx?page=1')
#=> #<URI::Generic:0x2020c2f6 URL:/main.rbx?page=1>

Source Code

# File uri/generic.rb, line 954
def route_to(oth)
  case oth
  when Generic
  when String
    oth = URI.parse(oth)
  else
    raise ArgumentError,
      "bad argument(expected URI object or URI string)"
  end

  oth.route_from(self)
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.