End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
URI.for
for(scheme, *arguments, default: Generic)
lib/uri/common.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/uri/common.rb, line 75
def self.for(scheme, *arguments, default: Generic)
if scheme
uri_class = @@schemes[scheme.upcase] || default
else
uri_class = default
end
return uri_class.new(scheme, *arguments)
end
Construct a URI instance, using the scheme to detect the appropriate class from URI.scheme_list.