instance method
URI::Generic#select
(*::Symbol components) -> ::Array[nil | ::String | ::Integer]
select(*components)
lib/uri/generic.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/uri/generic.rb, line 1444
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"]