Method: Bundler::URI::Generic#select

Defined in:
lib/bundler/vendor/uri/lib/uri/generic.rb

#select(*components) ⇒ Object

Args

components

Multiple Symbol arguments defined in Bundler::URI::HTTP.

Description

Selects specified components from Bundler::URI.

Usage

require 'bundler/vendor/uri/lib/uri'

uri = Bundler::URI.parse('http://myuser:[email protected]/test.rbx')
uri.select(:userinfo, :host, :path)
# => ["myuser:mypass", "my.example.com", "/test.rbx"]


1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
# File 'lib/bundler/vendor/uri/lib/uri/generic.rb', line 1430

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