Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
URI::Generic#path=
(::String? v) -> ::String?
path=(v)
lib/uri/generic.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/uri/generic.rb, line 815
def path=(v)
check_path(v)
set_path(v)
v
end
Args
v
Description
Public setter for the path component v (with validation).
See also URI::Generic.check_path.
Usage
Example
require 'uri' uri = URI.parse("http://my.example.com/pub/files") uri.path = "/faq/" uri.to_s #=> "http://my.example.com/faq/"