Class: UcbGroups::CampusGroup
- Inherits:
-
Object
- Object
- UcbGroups::CampusGroup
- Defined in:
- lib/ucb_groups/campus_group.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#dn ⇒ Object
Returns the value of attribute dn.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(ldap_entry) ⇒ CampusGroup
constructor
A new instance of CampusGroup.
Constructor Details
#initialize(ldap_entry) ⇒ CampusGroup
Returns a new instance of CampusGroup.
5 6 7 8 9 10 |
# File 'lib/ucb_groups/campus_group.rb', line 5 def initialize(ldap_entry) @dn = ldap_entry[:dn].first.to_s @name = ldap_entry[:displayName].first.to_s @description = ldap_entry[:description].first.to_s @namespace, @id = parse_dn end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/ucb_groups/campus_group.rb', line 3 def description @description end |
#dn ⇒ Object
Returns the value of attribute dn.
3 4 5 |
# File 'lib/ucb_groups/campus_group.rb', line 3 def dn @dn end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/ucb_groups/campus_group.rb', line 3 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/ucb_groups/campus_group.rb', line 3 def name @name end |
#namespace ⇒ Object
Returns the value of attribute namespace.
3 4 5 |
# File 'lib/ucb_groups/campus_group.rb', line 3 def namespace @namespace end |
Class Method Details
.find(namespace) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/ucb_groups/campus_group.rb', line 12 def self.find(namespace) args = { :base => "ou=campus groups,dc=berkeley,dc=edu", :filter => build_filter(namespace), :attributes => %w(name displayName description dn) } LdapConn.conn.search(args).map { |entry| CampusGroup.new(entry) } end |