| Class | LDAP::Schema |
| In: |
lib/ldap/schema.rb
|
| Parent: | Hash |
# File lib/ldap/schema.rb, line 16
16: def initialize(entry)
17: if( entry )
18: entry.each{|key,vals|
19: self[key] = vals
20: }
21: end
22: end
Return the list of attributes in object class oc that are of category at. at may be the string MUST, MAY or SUP.
# File lib/ldap/schema.rb, line 34
34: def attr(oc,at)
35: self['objectClasses'].each{|s|
36: if( s =~ /NAME\s+'#{oc}'/ )
37: case s
38: when /#{at}\s+\(([\w\d_\-\s\$]+)\)/i then return $1.split("$").collect{|attr| attr.strip}
39: when /#{at}\s+([\w\d_\-]+)/i then return $1.split("$").collect{|attr| attr.strip}
40: end
41: end
42: }
43: return nil
44: end
Return the list of values related to the schema component given in key. See LDAP::Conn#schema for common values of key.
# File lib/ldap/schema.rb, line 27
27: def names(key)
28: self[key].collect{|val| val =~ /NAME\s+'([\w\d_\-]+)'/; $1}
29: end