Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
URI::Generic#password=
password=(password)
lib/uri/generic.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/uri/generic.rb, line 498
def password=(password)
check_password(password)
set_password(password)
# returns password
end
Args
v
Description
Public setter for the password component (with validation).
See also URI::Generic.check_password.
Usage
Example
require 'uri' uri = URI.parse("http://john:[email protected]") uri.password = "V3ry_S3nsit1ve" uri.to_s #=> "http://john:[email protected]"