class Addressable::URI

def path=(new_path)

Experimental RBS support (using type sampling data from the type_fusion project).

def path=: (String new_path) -> untyped

This signature was generated using 8 samples from 2 applications.

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 || EMPTY_STR).to_str
  if !@path.empty? && @path[0..0] != SLASH && host != nil
    @path = "/#{@path}"
  end
  # Reset dependent values
  @normalized_path = nil
  remove_composite_values
  # Ensure we haven't created an invalid URI
  validate()
end