class Addressable::URI

def user=(new_user)

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

def user=: (nil new_user) -> nil

This signature was generated using 2 samples from 2 applications.

Parameters:
  • new_user (String, #to_str) -- The new user component.
def user=(new_user)
  if new_user && !new_user.respond_to?(:to_str)
    raise TypeError, "Can't convert #{new_user.class} into String."
  end
  @user = new_user ? new_user.to_str : nil
  # You can't have a nil user with a non-nil password
  if password != nil
    @user = EMPTY_STR unless user
  end
  # Reset dependent values
  @userinfo = nil
  @normalized_userinfo = NONE
  @authority = nil
  @normalized_user = NONE
  remove_composite_values
  # Ensure we haven't created an invalid URI
  validate()
end