@@ -15,24 +15,34 @@ class RegionalStudent < Patron::Student
1515 "PN" => "GR"
1616 }
1717
18- def campus_code
18+ def ldap_campus
1919 raise NotImplementedError
2020 end
2121
22- def ldap_campus
22+ def campus_code
2323 raise NotImplementedError
2424 end
2525
26- def term ( acad_period )
27- # 5th caracter in academic period is the index-1 of the semester
28- semester = [ "F" , "W" , "SP" , "SU" ] [ acad_period [ 4 ] . to_i - 1 ]
26+ def exclude_reason
27+ "not_registered" unless includable?
28+ end
2929
30- # the 2 digit year year unless it's fall.
31- year_ish = acad_period [ 2 , 2 ] . to_i
30+ def includable?
31+ current_term_status . any? do |term |
32+ term . registered == "Y" && @current_schedule . includable_term? ( term ( term . academicPeriod ) )
33+ end
34+ end
3235
33- year = ( semester == "F" ) ? year_ish - 1 : year_ish
36+ def job_description
37+ current_term_status . map do |term |
38+ term . programDesc
39+ end . compact . first
40+ end
3441
35- "#{ semester } #{ year } "
42+ def statistic_category
43+ current_term_status . map do |term |
44+ CLASS_STANDING_STATISTIC_CATEGORY_MAP [ term . classStanding ]
45+ end . compact . first
3646 end
3747
3848 def user_group
@@ -44,50 +54,40 @@ def user_group
4454 end
4555 end
4656
47- def statistic_category
48- current_term_status . map do |term |
49- CLASS_STANDING_STATISTIC_CATEGORY_MAP [ term . classStanding ]
50- end . compact . first
51- end
57+ def term ( acad_period )
58+ # 5th caracter in academic period is the index-1 of the semester
59+ semester = [ "F" , "W" , "SP" , "SU" ] [ acad_period [ 4 ] . to_i - 1 ]
5260
53- def current_term_status
54- ldap_fields ( @data [ "umich#{ ldap_campus } currenttermstatus" ] || [ ] )
55- end
61+ # the 2 digit year year unless it's fall.
62+ year_ish = acad_period [ 2 , 2 ] . to_i
5663
57- def job_description
58- current_term_status . map do |term |
59- term . programDesc
60- end . compact . first
61- end
64+ year = ( semester == "F" ) ? year_ish - 1 : year_ish
6265
63- def includable?
64- current_term_status . any? do |term |
65- term . registered == "Y" && @current_schedule . includable_term? ( term ( term . academicPeriod ) )
66- end
66+ "#{ semester } #{ year } "
6767 end
6868
69- def exclude_reason
70- "not_registered" unless includable?
69+ def current_term_status
70+ ldap_fields ( @data [ "umich #{ ldap_campus } currenttermstatus" ] || [ ] )
7171 end
7272 end
7373
7474 class DearbornStudent < Patron ::RegionalStudent
75- def campus_code
76- "UMDB"
77- end
78-
7975 def ldap_campus
8076 "dbrn"
8177 end
82- end
8378
84- class FlintStudent < Patron ::RegionalStudent
8579 def campus_code
86- "UMFL "
80+ "UMDB "
8781 end
82+ end
8883
84+ class FlintStudent < Patron ::RegionalStudent
8985 def ldap_campus
9086 "flnt"
9187 end
88+
89+ def campus_code
90+ "UMFL"
91+ end
9292 end
9393end
0 commit comments