Class: UCB::LDAP::Affiliation
- Inherits:
-
Entry
- Object
- Entry
- UCB::LDAP::Affiliation
show all
- Defined in:
- lib/ucb_ldap_affiliation.rb
Overview
UCB::LDAP::Affiliation
This class models a persons affiliate entries in the UCB LDAP directory.
affiliations = Affiliation.find_by_uid("1234")
Affiliation are usually loaded through a Person instance:
p = Person.find_by_uid("1234") affs = p.affiliations
Note on Binds
You must have a privileged bind and pass your credentials to UCB::LDAP.authenticate() before performing your Affiliation search.
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Entry
#assigned_attributes, #attributes, canonical, #canonical, combine_filters, create, create!, #delete, #delete!, #dn, entity_name, find_by_dn, #initialize, make_search_filter, #method_missing, #modify, #modify_operations, #net_ldap, net_ldap, object_classes, schema_attribute, schema_attributes_array, schema_attributes_hash, search, set_schema_attributes, #setter_method?, tree_base, tree_base=, unique_object_class, #update_attributes, #update_attributes!, #value_getter, #value_setter
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class UCB::LDAP::Entry
Class Method Details
.find_by_uid(uid) ⇒ Object
Returns an Array of Affiliation for uid
. Returns an empty Array ([]) if nothing is found.
75
76
77
78
79
|
# File 'lib/ucb_ldap_affiliation.rb', line 75
def find_by_uid(uid)
base = "uid=#{uid},ou=people,dc=berkeley,dc=edu"
filter = Net::LDAP::Filter.eq("objectclass", 'berkeleyEduPersonAffiliate')
search(:base => base, :filter => filter)
end
|
Instance Method Details
#affiliate_id ⇒ Object
35
36
37
|
# File 'lib/ucb_ldap_affiliation.rb', line 35
def affiliate_id
berkeleyEduAffID.first
end
|
#affiliate_type ⇒ Object
39
40
41
|
# File 'lib/ucb_ldap_affiliation.rb', line 39
def affiliate_type
berkeleyEduAffType
end
|
#create_datetime ⇒ Object
23
24
25
|
# File 'lib/ucb_ldap_affiliation.rb', line 23
def create_datetime
berkeleyEduAffCreateDate
end
|
#dept_code ⇒ Object
63
64
65
|
# File 'lib/ucb_ldap_affiliation.rb', line 63
def dept_code
departmentNumber.first
end
|
#dept_name ⇒ Object
67
68
69
|
# File 'lib/ucb_ldap_affiliation.rb', line 67
def dept_name
berkeleyEduUnitCalNetDeptName
end
|
#expiration_date ⇒ Object
31
32
33
|
# File 'lib/ucb_ldap_affiliation.rb', line 31
def expiration_date
UCB::LDAP.local_date_parse(berkeleyEduAffExpDate)
end
|
#expired_by ⇒ Object
27
28
29
|
# File 'lib/ucb_ldap_affiliation.rb', line 27
def expired_by
berkeleyEduAffExpBy
end
|
#first_name ⇒ Object
43
44
45
|
# File 'lib/ucb_ldap_affiliation.rb', line 43
def first_name
givenName.first
end
|
#last_name ⇒ Object
51
52
53
|
# File 'lib/ucb_ldap_affiliation.rb', line 51
def last_name
sn.first
end
|
#middle_name ⇒ Object
47
48
49
|
# File 'lib/ucb_ldap_affiliation.rb', line 47
def middle_name
berkeleyEduMiddleName
end
|
#modified_by ⇒ Object
55
56
57
|
# File 'lib/ucb_ldap_affiliation.rb', line 55
def modified_by
berkeleyEduModifiedBy
end
|
#source ⇒ Object
59
60
61
|
# File 'lib/ucb_ldap_affiliation.rb', line 59
def source
berkeleyEduPersonAffiliateSource
end
|