- A
- B
- D
- E
- F
- H
- N
- S
Constants
COMPONENT | = | [ :scheme, :host, :port, :dn, :attributes, :scope, :filter, :extensions, ].freeze |
DEFAULT_PORT | = | 389 |
A Default port of 389 for |
||
SCOPE | = | [ SCOPE_ONE = 'one', SCOPE_SUB = 'sub', SCOPE_BASE = 'base', ].freeze |
Scopes available for the starting point.
|
Class Public methods
build(args) Link
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:
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])
# File ruby/lib/uri/ldap.rb, line 74 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
new(*arg) Link
Description
Creates a new URI::LDAP
object from generic URI
components as per RFC 2396. No LDAP-specific syntax checking is performed.
Arguments are scheme
, userinfo
, host
, port
, registry
, path
, opaque
, query
, and fragment
, in that order.
Example:
uri = URI::LDAP.new("ldap", nil, "ldap.example.com", nil, nil,
"/dc=example;dc=com", nil, "query", nil)
See also URI::Generic.new
.
Instance Public methods
attributes() Link
Returns attributes.
attributes=(val) Link
Setter for attributes val
.
dn=(val) Link
Setter for dn val
.
extensions() Link
Returns extensions.
extensions=(val) Link
Setter for extensions val
.
filter() Link
Returns filter.
filter=(val) Link
Setter for filter val
.
hierarchical?() Link
scope() Link
Returns scope.
scope=(val) Link
Setter for scope val
.
Instance Protected methods
set_attributes(val) Link
Private setter for attributes val
.
set_dn(val) Link
Private setter for dn val
.
set_extensions(val) Link
Private setter for extensions val
.
set_filter(val) Link
Private setter for filter val
.