Class: UCB::LDAP::StudentTerm

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

Overview

UCB::LDAP::StudentTerm

This class models a student’s term entries in the UCB LDAP directory.

terms = StudentTerm.find_by_uid("1234")       #=> [#<UCB::LDAP::StudentTerm: ...>, ...]

StudentTerms are usually loaded through a Person instance:

p = Person.find_by_uid("1234")    #=> #<UCB::LDAP::Person: ...>
terms = p.student_terms        #=> [#<UCB::LDAP::StudentTerm: ...>, ...]

Note on Binds

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



92
93
94
95
96
# File 'lib/ucb_ldap_student_term.rb', line 92

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

Instance Method Details

#change_datetimeObject



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

def change_datetime
  UCB::LDAP.local_datetime_parse(berkeleyEduStuChangeDate)
end

#college_codeObject



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

def college_code
  berkeleyEduStuCollegeCode
end

#college_nameObject



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

def college_name
  berkeleyEduStuCollegeName
end

#level_codeObject



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

def level_code
  berkeleyEduStuEduLevelCode
end

#level_nameObject



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

def level_name
  berkeleyEduStuEduLevelName
end

#major_codeObject



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

def major_code
  berkeleyEduStuMajorCode
end

#major_nameObject



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

def major_name
  berkeleyEduStuMajorName
end

#registration_status_codeObject



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

def registration_status_code
  berkeleyEduStuRegStatCode
end

#registration_status_nameObject



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

def registration_status_name
  berkeleyEduStuRegStatName
end

#role_codeObject



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

def role_code
  berkeleyEduStuEduRoleCode
end

#role_nameObject



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

def role_name
  berkeleyEduStuEduRoleName
end

#term_codeObject



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

def term_code
  berkeleyEduStuTermCode
end

#term_nameObject



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

def term_name
  berkeleyEduStuTermName
end

#term_statusObject



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

def term_status
  berkeleyEduStuTermStatus
end

#term_yearObject



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

def term_year
  berkeleyEduStuTermYear
end

#under_graduate_codeObject



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

def under_graduate_code
  berkeleyEduStuUGCode
end