Class: UCB::LDAP::JobAppointment

Inherits:
Entry
  • Object
show all
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

Instance Method Summary collapse

Methods inherited from Entry

#attributes, #canonical, canonical, combine_filters, create, create!, #delete, #delete!, #dn, entity_name, find_by_dn, hydrate, #initialize, make_search_filter, #method_missing, #modify, #modify_operations, #net_ldap, net_ldap, #new_record?, object_classes, required_attributes, schema_attribute, schema_attributes_array, schema_attributes_hash, search, set_schema_attributes, #setter_method?, #tainted_attributes, 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_typeObject



56
57
58
# File 'lib/ucb_ldap_person_job_appointment.rb', line 56

def appointment_type
  berkeleyEduPersonJobApptType
end

#cto_codeObject



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

def cto_code
  berkeleyEduPersonJobApptCTOCode
end

#deptidObject



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

def deptid
  berkeleyEduPersonJobApptDepartment
end

#erc_codeObject

Returns Employee Relation Code



44
45
46
# File 'lib/ucb_ldap_person_job_appointment.rb', line 44

def erc_code
  berkeleyEduPersonJobApptRelationsCode
end

#personnel_program_codeObject



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

def personnel_program_code
  berkeleyEduPersonJobApptPersPgmCode
end

#primary?Boolean

Returns:

  • (Boolean)


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

def primary?
  berkeleyEduPersonJobApptPrimaryFlag
end

#record_numberObject



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

def record_number
  berkeleyEduPersonJobApptEmpRecNumber.to_i
end

#represented?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/ucb_ldap_person_job_appointment.rb', line 48

def represented?
  berkeleyEduPersonJobApptRepresentation != 'U'
end

#title_codeObject



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

Returns:

  • (Boolean)


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

def wos?
  berkeleyEduPersonJobApptWOS
end