Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
URI::Generic#set_userinfo
(::String? user, ?::String? password) -> [ ::String?, ::String? ]
set_userinfo(user, password = nil)
lib/uri/generic.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/uri/generic.rb, line 509
def set_userinfo(user, password = nil)
unless password
user, password = split_userinfo(user)
end
@user = user
@password = password if password
[@user, @password]
end
Protected setter for the user component, and password if available (with validation).
See also URI::Generic.userinfo=.
See also
#set_user
#split_path
#set_scheme
#split_userinfo
also in
4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0