Class: KU::LDAP::Entry::Base
- Inherits:
-
Object
- Object
- KU::LDAP::Entry::Base
- Defined in:
- lib/ku/ldap/entry/base.rb
Constant Summary collapse
- BASE =
ENV['KU_LDAP_BASE'] || 'dc=sc,dc=ku,dc=dk'
Class Method Summary collapse
- .first(directory, id, filter = Filter.new) ⇒ Object
- .search(directory, attribute, value, matcher, filter = Filter.new) ⇒ Object
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eq?)
-
#initialize(entry) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(entry) ⇒ Base
Returns a new instance of Base.
20 21 22 |
# File 'lib/ku/ldap/entry/base.rb', line 20 def initialize entry @entry = entry || Hash.new([]) end |
Class Method Details
.first(directory, id, filter = Filter.new) ⇒ Object
10 11 12 13 |
# File 'lib/ku/ldap/entry/base.rb', line 10 def self.first directory, id, filter=Filter.new entry = directory.first base, filter.eq(identifier, id) new entry if entry end |
.search(directory, attribute, value, matcher, filter = Filter.new) ⇒ Object
15 16 17 18 |
# File 'lib/ku/ldap/entry/base.rb', line 15 def self.search directory, attribute, value, matcher, filter=Filter.new filt = filter.send matcher.to_sym, attribute, value Array(directory.search(base, filt)).map {|entry| new entry} end |
Instance Method Details
#==(other) ⇒ Object Also known as: eq?
24 25 26 |
# File 'lib/ku/ldap/entry/base.rb', line 24 def ==(other) id == other.id end |