Class: UCB::LDAP::Address
- Inherits:
-
Entry
- Object
- Entry
- UCB::LDAP::Address
show all
- Defined in:
- lib/ucb_ldap/address.rb
Overview
UCB::LDAP::Address
This class models a person address instance in the UCB LDAP directory.
a = Address.find_by_uid("1234")
Addresses are usually loaded through a Person instance:
p = Person.find_by_uid("1234") addrs = p.addresses
Note on Binds
You must have a privileged bind and pass your credentials to UCB::LDAP.authenticate() before performing your Address search.
Constant Summary
Constants inherited
from Entry
Entry::TESTING
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Entry
#assigned_attributes, #attributes, canonical, #canonical, combine_filters, create, create!, #dn, entity_name, filter_in, find_by_dn, #initialize, make_search_filter, #method_missing, net_ldap, #net_ldap, object_classes, required_attributes, required_schema_attributes, schema_attribute, schema_attributes_array, schema_attributes_hash, search, set_schema_attributes, tree_base, tree_base=, unique_object_class
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 Address for uid
, sorted by sort_order(). Returns an empty Array ([]) if nothing is found.
103
104
105
106
|
# File 'lib/ucb_ldap/address.rb', line 103
def find_by_uid(uid)
warn "DEPRECATED: Addresses are no longer supported by LDAP. This method will always return an empty Array"
[]
end
|
Instance Method Details
#address_type ⇒ Object
27
28
29
30
|
# File 'lib/ucb_ldap/address.rb', line 27
def address_type
warn "DEPRECATED: address_type is no longer supported"
[]
end
|
#building_code ⇒ Object
32
33
34
35
|
# File 'lib/ucb_ldap/address.rb', line 32
def building_code
warn "DEPRECATED: building_code is no longer supported"
[]
end
|
#city ⇒ Object
37
38
39
|
# File 'lib/ucb_ldap/address.rb', line 37
def city
l.first
end
|
#country_code ⇒ Object
41
42
43
44
|
# File 'lib/ucb_ldap/address.rb', line 41
def country_code
warn "DEPRECATED: country_code is no longer supported"
[]
end
|
#department_acronym ⇒ Object
51
52
53
|
# File 'lib/ucb_ldap/address.rb', line 51
def department_acronym
berkeleyEduPersonAddressUnitHRDeptName
end
|
#department_name ⇒ Object
46
47
48
49
|
# File 'lib/ucb_ldap/address.rb', line 46
def department_name
warn "DEPRECATED: department_name is no longer supported"
[]
end
|
#directories ⇒ Object
55
56
57
58
|
# File 'lib/ucb_ldap/address.rb', line 55
def directories
warn "DEPRECATED: directories is no longer supported"
[]
end
|
#email ⇒ Object
Returns email address associated with this Address.
61
62
63
|
# File 'lib/ucb_ldap/address.rb', line 61
def email
mail.first
end
|
#mail_code ⇒ Object
65
66
67
|
# File 'lib/ucb_ldap/address.rb', line 65
def mail_code
berkeleyEduPersonAddressMailCode
end
|
#mail_release? ⇒ Boolean
69
70
71
|
# File 'lib/ucb_ldap/address.rb', line 69
def mail_release?
berkeleyEduEmailRelFlag
end
|
#phone ⇒ Object
73
74
75
|
# File 'lib/ucb_ldap/address.rb', line 73
def phone
telephoneNumber.first
end
|
#postal_address ⇒ Object
Returns postal address as an Array.
addr.attribute(:postalAddress) addr.postal_address
82
83
84
|
# File 'lib/ucb_ldap/address.rb', line 82
def postal_address
postalAddress == [] ? nil : postalAddress.split("$")
end
|
#primary_work_address? ⇒ Boolean
23
24
25
|
# File 'lib/ucb_ldap/address.rb', line 23
def primary_work_address?
berkeleyEduPersonAddressPrimaryFlag
end
|
#sort_order ⇒ Object
86
87
88
89
|
# File 'lib/ucb_ldap/address.rb', line 86
def sort_order
warn "DEPRECATED: sort_order is no longer supported"
0
end
|
#state ⇒ Object
91
92
93
|
# File 'lib/ucb_ldap/address.rb', line 91
def state
st.first
end
|
#zip ⇒ Object
95
96
97
|
# File 'lib/ucb_ldap/address.rb', line 95
def zip
postalCode
end
|