Class: UCB::LDAP::JobAppointment
- Defined in:
- lib/ucb_ldap_person_job_appointment.rb
Overview
UCB::LDAP::JobAppointment
This class models a person’s job appointment instance in the UCB LDAP directory.
appts = JobAppontment.find_by_uid("1234") #=> [#<UCB::LDAP::JobAppointment: ...>, ...]
JobAppointments are usually loaded through a Person instance:
p = Person.find_by_uid("1234") #=> #<UCB::LDAP::Person: ...>
appts = p.job_appointments #=> [#<UCB::LDAP::JobAppointment: ...>, ...]
Note on Binds
You must have a privileged bind and pass your credentials to UCB::LDAP.authenticate() before performing your JobAppointment search.
Class Method Summary collapse
-
.find_by_uid(uid) ⇒ Object
Returns an Array of JobAppointment for
uid
, sorted by record_number().
Instance Method Summary collapse
- #appointment_type ⇒ Object
- #cto_code ⇒ Object
- #deptid ⇒ Object
-
#erc_code ⇒ Object
Returns Employee Relation Code.
- #personnel_program_code ⇒ Object
- #primary? ⇒ Boolean
- #record_number ⇒ Object
- #represented? ⇒ Boolean
- #title_code ⇒ Object
-
#wos? ⇒ Boolean
Returns
true
if appointment is Without Salary.
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.
70 71 72 73 74 |
# File 'lib/ucb_ldap_person_job_appointment.rb', line 70 def find_by_uid(uid) base = "uid=#{uid},ou=people,dc=berkeley,dc=edu" filter = Net::LDAP::Filter.eq("objectclass", 'berkeleyEduPersonJobAppt') search(:base => base, :filter => filter).sort_by{|appt| appt.record_number} end |
Instance Method Details
#appointment_type ⇒ Object
56 57 58 |
# File 'lib/ucb_ldap_person_job_appointment.rb', line 56 def appointment_type berkeleyEduPersonJobApptType end |
#cto_code ⇒ Object
23 24 25 |
# File 'lib/ucb_ldap_person_job_appointment.rb', line 23 def cto_code berkeleyEduPersonJobApptCTOCode end |
#deptid ⇒ Object
27 28 29 |
# File 'lib/ucb_ldap_person_job_appointment.rb', line 27 def deptid berkeleyEduPersonJobApptDepartment end |
#erc_code ⇒ Object
Returns Employee Relation Code
44 45 46 |
# File 'lib/ucb_ldap_person_job_appointment.rb', line 44 def erc_code berkeleyEduPersonJobApptRelationsCode end |
#personnel_program_code ⇒ Object
35 36 37 |
# File 'lib/ucb_ldap_person_job_appointment.rb', line 35 def personnel_program_code berkeleyEduPersonJobApptPersPgmCode end |
#primary? ⇒ Boolean
39 40 41 |
# File 'lib/ucb_ldap_person_job_appointment.rb', line 39 def primary? berkeleyEduPersonJobApptPrimaryFlag end |
#record_number ⇒ Object
31 32 33 |
# File 'lib/ucb_ldap_person_job_appointment.rb', line 31 def record_number berkeleyEduPersonJobApptEmpRecNumber.to_i end |
#represented? ⇒ Boolean
48 49 50 |
# File 'lib/ucb_ldap_person_job_appointment.rb', line 48 def represented? berkeleyEduPersonJobApptRepresentation != 'U' end |
#title_code ⇒ Object
52 53 54 |
# File 'lib/ucb_ldap_person_job_appointment.rb', line 52 def title_code berkeleyEduPersonJobApptTitleCode end |
#wos? ⇒ Boolean
Returns true
if appointment is Without Salary
61 62 63 |
# File 'lib/ucb_ldap_person_job_appointment.rb', line 61 def wos? berkeleyEduPersonJobApptWOS end |