class Addressable::URI

def replace_self(uri)

Returns:
  • (Addressable::URI) - self.

Parameters:
  • uri (Addressable::URI) -- The URI to replace self with.
def replace_self(uri)
  # Reset dependent values
  instance_variables.each do |var|
    if instance_variable_defined?(var) && var != :@validation_deferred
      remove_instance_variable(var)
    end
  end
  @scheme = uri.scheme
  @user = uri.user
  @password = uri.password
  @host = uri.host
  @port = uri.port
  @path = uri.path
  @query = uri.query
  @fragment = uri.fragment
  return self
end