Skip to content
class method

URI::LDAP.build

(::Array[nil | ::String | ::Integer] args) -> ::URI::LDAP
({ host: ::String?, port: ::Integer?, dn: ::String?, attributes: ::String?, scope: ::String?, filter: ::String?, extensions: ::String? }) -> ::URI::LDAP
build(args)

Description

Creates a new URI::LDAP object from components, with syntax checking.

The components accepted are host, port, dn, attributes, scope, filter, and extensions.

The components should be provided either as an Array, or as a Hash with keys formed by preceding the component names with a colon.

If an Array is used, the components must be passed in the order [host, port, dn, attributes, scope, filter, extensions].

Example:

Example
uri = URI::LDAP.build({:host => 'ldap.example.com',
  :dn => '/dc=example'})

uri = URI::LDAP.build(["ldap.example.com", nil,
  "/dc=example;dc=com", "query", nil, nil, nil])
See also .new #attributes also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0