Class: UcbGroups::MembershipFinder
- Inherits:
-
Object
- Object
- UcbGroups::MembershipFinder
- Defined in:
- lib/ucb_groups/membership_finder.rb
Instance Attribute Summary collapse
-
#groups ⇒ Object
Returns the value of attribute groups.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#orgs ⇒ Object
Returns the value of attribute orgs.
Instance Method Summary collapse
- #find(*options) ⇒ Object
-
#initialize(namespace) ⇒ MembershipFinder
constructor
A new instance of MembershipFinder.
Constructor Details
#initialize(namespace) ⇒ MembershipFinder
Returns a new instance of MembershipFinder.
5 6 7 |
# File 'lib/ucb_groups/membership_finder.rb', line 5 def initialize(namespace) @namespace = namespace end |
Instance Attribute Details
#groups ⇒ Object
Returns the value of attribute groups.
3 4 5 |
# File 'lib/ucb_groups/membership_finder.rb', line 3 def groups @groups end |
#namespace ⇒ Object
Returns the value of attribute namespace.
3 4 5 |
# File 'lib/ucb_groups/membership_finder.rb', line 3 def namespace @namespace end |
#orgs ⇒ Object
Returns the value of attribute orgs.
3 4 5 |
# File 'lib/ucb_groups/membership_finder.rb', line 3 def orgs @orgs end |
Instance Method Details
#find(*options) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ucb_groups/membership_finder.rb', line 9 def find(*) @groups, @orgs = () return [] if @groups.empty? && @orgs.empty? args = { base: "ou=people,dc=berkeley,dc=edu", filter: membership_filter, attributes: Person.ldap_attributes } LdapConn.conn.search(args).map { |entry| Person.new(entry) } end |