Class: UCB::LDAP::Service

Inherits:
Entry
  • Object
show all
Defined in:
lib/ucb_ldap_service.rb

Overview

UCB::LDAP::Service

This class models a person’s service entries in the UCB LDAP directory.

services = Services.find_by_uid("1234")       #=> [#<UCB::LDAP::Service: ...>, ...]

Servicess are usually loaded through a Person instance:

p = Person.find_by_uid("1234")    #=> #<UCB::LDAP::Person: ...>
services = p.services        #=> [#<UCB::LDAP::Service: ...>, ...]

Note on Binds

You must have a privileged bind and pass your credentials to UCB::LDAP.authenticate() before performing your Service 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

Constructor Details

This class inherits a constructor from UCB::LDAP::Entry

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 JobAppointment for uid, sorted by record_number(). Returns an empty Array ([]) if nothing is found.



100
101
102
103
104
# File 'lib/ucb_ldap_service.rb', line 100

def find_by_uid(uid)
  base = "uid=#{uid},ou=people,dc=berkeley,dc=edu"
  filter = Net::LDAP::Filter.eq("objectclass", 'berkeleyEduPersonService')
  search(:base => base, :filter => filter)
end

Instance Method Details

#common_nameObject



87
88
89
# File 'lib/ucb_ldap_service.rb', line 87

def common_name
  cn
end

#descriptionObject



91
92
93
# File 'lib/ucb_ldap_service.rb', line 91

def description
  super.first
end

#eligible_byObject



23
24
25
# File 'lib/ucb_ldap_service.rb', line 23

def eligible_by
  berkeleyEduPersonServiceEligibleBy
end

#eligible_dateObject



27
28
29
# File 'lib/ucb_ldap_service.rb', line 27

def eligible_date
  berkeleyEduPersonServiceEligibleDate
end

#end_dateObject



35
36
37
# File 'lib/ucb_ldap_service.rb', line 35

def end_date
  berkeleyEduPersonServiceEndDate
end

#ended_byObject



31
32
33
# File 'lib/ucb_ldap_service.rb', line 31

def ended_by
  berkeleyEduPersonServiceEndBy
end

#entered_byObject



39
40
41
# File 'lib/ucb_ldap_service.rb', line 39

def entered_by
  berkeleyEduPersonServiceEnteredBy
end

#entered_dateObject



43
44
45
# File 'lib/ucb_ldap_service.rb', line 43

def entered_date
  berkeleyEduPersonServiceEnteredDate
end

#levelObject



47
48
49
# File 'lib/ucb_ldap_service.rb', line 47

def level
  berkeleyEduPersonServiceLevel
end

#modified_byObject



51
52
53
# File 'lib/ucb_ldap_service.rb', line 51

def modified_by
  berkeleyEduPersonServiceModifiedBy
end

#modified_dateObject



55
56
57
# File 'lib/ucb_ldap_service.rb', line 55

def modified_date
  berkeleyEduPersonServiceModifiedDate
end

#naughty_bitObject



59
60
61
# File 'lib/ucb_ldap_service.rb', line 59

def naughty_bit
  berkeleyEduPersonServiceNaughtyBit
end

#notified_byObject



63
64
65
# File 'lib/ucb_ldap_service.rb', line 63

def notified_by
  berkeleyEduPersonServiceNotifyBy
end

#notify_dateObject



67
68
69
# File 'lib/ucb_ldap_service.rb', line 67

def notify_date
  berkeleyEduPersonServiceNotifyDate
end

#serviceObject



83
84
85
# File 'lib/ucb_ldap_service.rb', line 83

def service
  berkeleyEduService
end

#stop_dateObject



75
76
77
# File 'lib/ucb_ldap_service.rb', line 75

def stop_date
  berkeleyEduPersonServiceStopDate
end

#stopped_byObject



71
72
73
# File 'lib/ucb_ldap_service.rb', line 71

def stopped_by
  berkeleyEduPersonServiceStopBy
end

#valueObject



79
80
81
# File 'lib/ucb_ldap_service.rb', line 79

def value
  berkeleyEduPersonServiceValue
end