Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

URI::LDAP.build

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 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0