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, required_attributes, required_schema_attributes, 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.



103
104
105
106
107
# File 'lib/ucb_ldap_service.rb', line 103

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



89
90
91
# File 'lib/ucb_ldap_service.rb', line 89

def common_name
  cn
end

#descriptionObject



93
94
95
# File 'lib/ucb_ldap_service.rb', line 93

def description
  super.first
end

#eligible_byObject



25
26
27
# File 'lib/ucb_ldap_service.rb', line 25

def eligible_by
  berkeleyEduPersonServiceEligibleBy
end

#eligible_dateObject



29
30
31
# File 'lib/ucb_ldap_service.rb', line 29

def eligible_date
  berkeleyEduPersonServiceEligibleDate
end

#end_dateObject



37
38
39
# File 'lib/ucb_ldap_service.rb', line 37

def end_date
  berkeleyEduPersonServiceEndDate
end

#ended_byObject



33
34
35
# File 'lib/ucb_ldap_service.rb', line 33

def ended_by
  berkeleyEduPersonServiceEndBy
end

#entered_byObject



41
42
43
# File 'lib/ucb_ldap_service.rb', line 41

def entered_by
  berkeleyEduPersonServiceEnteredBy
end

#entered_dateObject



45
46
47
# File 'lib/ucb_ldap_service.rb', line 45

def entered_date
  berkeleyEduPersonServiceEnteredDate
end

#levelObject



49
50
51
# File 'lib/ucb_ldap_service.rb', line 49

def level
  berkeleyEduPersonServiceLevel
end

#modified_byObject



53
54
55
# File 'lib/ucb_ldap_service.rb', line 53

def modified_by
  berkeleyEduPersonServiceModifiedBy
end

#modified_dateObject



57
58
59
# File 'lib/ucb_ldap_service.rb', line 57

def modified_date
  berkeleyEduPersonServiceModifiedDate
end

#naughty_bitObject



61
62
63
# File 'lib/ucb_ldap_service.rb', line 61

def naughty_bit
  berkeleyEduPersonServiceNaughtyBit
end

#notified_byObject



65
66
67
# File 'lib/ucb_ldap_service.rb', line 65

def notified_by
  berkeleyEduPersonServiceNotifyBy
end

#notify_dateObject



69
70
71
# File 'lib/ucb_ldap_service.rb', line 69

def notify_date
  berkeleyEduPersonServiceNotifyDate
end

#serviceObject



85
86
87
# File 'lib/ucb_ldap_service.rb', line 85

def service
  berkeleyEduService
end

#stop_dateObject



77
78
79
# File 'lib/ucb_ldap_service.rb', line 77

def stop_date
  berkeleyEduPersonServiceStopDate
end

#stopped_byObject



73
74
75
# File 'lib/ucb_ldap_service.rb', line 73

def stopped_by
  berkeleyEduPersonServiceStopBy
end

#valueObject



81
82
83
# File 'lib/ucb_ldap_service.rb', line 81

def value
  berkeleyEduPersonServiceValue
end