class Addressable::URI

def self.join(*uris)

Returns:
  • (Addressable::URI) - The joined URI.

Parameters:
  • *uris (String, Addressable::URI, #to_str) --
def self.join(*uris)
  uri_objects = uris.collect do |uri|
    if !uri.respond_to?(:to_str)
      raise TypeError, "Can't convert #{uri.class} into String."
    end
    uri.kind_of?(self) ? uri : self.parse(uri.to_str)
  end
  result = uri_objects.shift.dup
  for uri in uri_objects
    result.join!(uri)
  end
  return result
end