End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
URI::Generic#select
select(*components)
lib/uri/generic.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/uri/generic.rb, line 1429
def select(*components)
components.collect do |c|
if component.include?(c)
self.__send__(c)
else
raise ArgumentError,
"expected of components of #{self.class} (#{self.class.component.join(', ')})"
end
end
end
Args
Description
Selects specified components from URI.
Usage
Example
require 'uri' uri = URI.parse('http://myuser:[email protected]/test.rbx') uri.select(:userinfo, :host, :path) # => ["myuser:mypass", "my.example.com", "/test.rbx"]