class Gem::URI::LDAP
def self.build(args)
"/dc=example;dc=com", "query", nil, nil, nil])
uri = Gem::URI::LDAP.build(["ldap.example.com", nil,
:dn => '/dc=example'})
uri = Gem::URI::LDAP.build({:host => 'ldap.example.com',
Example:
order
[host, port, dn, attributes, scope, filter, extensions]
.If an Array is used, the components must be passed in the
with keys formed by preceding the component names with a colon.
The components should be provided either as an Array, or as a Hash
scope, filter, and extensions.
The components accepted are host, port, dn, attributes,
Creates a new Gem::URI::LDAP object from components, with syntax checking.
== Description
def self.build(args) tmp = Util::make_components_hash(self, args) if tmp[:dn] tmp[:path] = tmp[:dn] end query = [] [:extensions, :filter, :scope, :attributes].collect do |x| next if !tmp[x] && query.size == 0 query.unshift(tmp[x]) end tmp[:query] = query.join('?') return super(tmp) end