class Addressable::URI
def user=(new_user)
-
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 = EMPTYSTR if @user.nil? end # Reset dependant values @userinfo = nil @normalized_userinfo = nil @authority = nil @normalized_user = nil @uri_string = nil @hash = nil # Ensure we haven't created an invalid URI validate() end