5 # Takaaki Tateishi <ttate@jaist.ac.jp>
6 # Akira Yamada <akira@ruby-lang.org>
8 # URI::LDAP is copyrighted free software by Takaaki Tateishi and Akira Yamada.
9 # You can redistribute it and/or modify it under the same term as Ruby.
18 # LDAP URI SCHEMA (described in RFC2255)
19 # ldap://<host>/<dn>[?<attrs>[?<scope>[?<filter>[?<extensions>]]]]
42 tmp = Util::make_components_hash(self, args)
49 [:extensions, :filter, :scope, :attributes].collect do |x|
50 next if !tmp[x] && query.size == 0
54 tmp[:query] = query.join('?')
63 raise InvalidURIError, 'bad LDAP URL'
82 attrs, scope, filter, extensions = @query.split('?')
84 @attributes = attrs if attrs && attrs.size > 0
85 @scope = scope if scope && scope.size > 0
86 @filter = filter if filter && filter.size > 0
87 @extensions = extensions if extensions && extensions.size > 0
96 [@extensions, @filter, @scope, @attributes].each do |x|
97 next if !x && query.size == 0
100 @query = query.join('?')
102 private :build_path_query
124 def set_attributes(val)
129 protected :set_attributes
161 protected :set_filter
172 def set_extensions(val)
177 protected :set_extensions
189 @@schemes['LDAP'] = LDAP