- A
- B
- D
- E
- F
- H
- N
- P
- S
DEFAULT_PORT | = | 389 |
A Default port of 389 for URI::LDAP |
||
COMPONENT | = | [ :scheme, :host, :port, :dn, :attributes, :scope, :filter, :extensions, ].freeze |
An Array of the available components for URI::LDAP |
||
SCOPE | = | [ SCOPE_ONE = 'one', SCOPE_SUB = 'sub', SCOPE_BASE = 'base', ].freeze |
Scopes available for the starting point.
|
Description
Create 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:
newuri = URI::LDAP.build({:host => 'ldap.example.com',
:dn> => '/dc=example'})
newuri = URI::LDAP.build(["ldap.example.com", nil,
"/dc=example;dc=com", "query", nil, nil, nil])
# File ../ruby/lib/uri/ldap.rb, line 73 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
Description
Create 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,
"/dc=example;dc=com", "query", nil, nil, nil, nil)
See also URI::Generic.new
returns attributes.
setter for attributes val
returns dn.
setter for dn val
returns extensions.
setter for extensions val
returns filter.
setter for filter val
returns scope.
setter for scope val
private setter for attributes val
private setter for dn val
private setter for extensions val
private setter for filter val
private setter for scope val
private method to assemble query
from attributes
,
scope
, filter
and extensions
.
private method to cleanup dn
from using the path
component attribute
private method to cleanup attributes
, scope
,
filter
and extensions
, from using the
query
component attribute
# File ../ruby/lib/uri/ldap.rb, line 127 def parse_query @attributes = nil @scope = nil @filter = nil @extensions = nil if @query attrs, scope, filter, extensions = @query.split('?') @attributes = attrs if attrs && attrs.size > 0 @scope = scope if scope && scope.size > 0 @filter = filter if filter && filter.size > 0 @extensions = extensions if extensions && extensions.size > 0 end end