class Addressable::URI

def path=(new_path)

Parameters:
  • new_path (String, #to_str) -- The new path component.
def path=(new_path)
  if new_path && !new_path.respond_to?(:to_str)
    raise TypeError, "Can't convert #{new_path.class} into String."
  end
  @path = (new_path || EMPTYSTR).to_str
  if !@path.empty? && @path[0..0] != SLASH && host != nil
    @path = "/#{@path}"
  end
  # Reset dependant values
  @normalized_path = nil
  @uri_string = nil
  @hash = nil
end