Class: Regis::Response::Model::Section
- Defined in:
- lib/regis/responses/models/section.rb
Instance Attribute Summary collapse
-
#audits_long_name ⇒ Object
readonly
Returns the value of attribute audits_long_name.
-
#corequisites ⇒ Object
readonly
Returns the value of attribute corequisites.
-
#course_description ⇒ Object
readonly
Returns the value of attribute course_description.
-
#course_name ⇒ Object
readonly
Returns the value of attribute course_name.
-
#course_title ⇒ Object
readonly
Returns the value of attribute course_title.
-
#credits_long_name ⇒ Object
readonly
Returns the value of attribute credits_long_name.
-
#current_status ⇒ Object
readonly
Returns the value of attribute current_status.
-
#end_date ⇒ Object
readonly
Returns the value of attribute end_date.
-
#end_times ⇒ Object
readonly
Returns the value of attribute end_times.
-
#instructors ⇒ Object
readonly
Returns the value of attribute instructors.
-
#is_audio ⇒ Object
readonly
Returns the value of attribute is_audio.
-
#is_evening ⇒ Object
readonly
Returns the value of attribute is_evening.
-
#is_oncampus ⇒ Object
readonly
Returns the value of attribute is_oncampus.
-
#is_pass_fail ⇒ Object
readonly
Returns the value of attribute is_pass_fail.
-
#is_unlisted ⇒ Object
readonly
Returns the value of attribute is_unlisted.
-
#is_waitlist ⇒ Object
readonly
Returns the value of attribute is_waitlist.
-
#is_weekday ⇒ Object
readonly
Returns the value of attribute is_weekday.
-
#is_weekend ⇒ Object
readonly
Returns the value of attribute is_weekend.
-
#location_code ⇒ Object
readonly
Returns the value of attribute location_code.
-
#location_long_name ⇒ Object
readonly
Returns the value of attribute location_long_name.
-
#meeting_days ⇒ Object
readonly
Returns the value of attribute meeting_days.
-
#prerequisites ⇒ Object
readonly
Returns the value of attribute prerequisites.
-
#reporting_term ⇒ Object
readonly
Returns the value of attribute reporting_term.
-
#room ⇒ Object
readonly
Returns the value of attribute room.
-
#section_code ⇒ Object
readonly
Returns the value of attribute section_code.
-
#secUUID ⇒ Object
readonly
Returns the value of attribute secUUID.
-
#start_date ⇒ Object
readonly
Returns the value of attribute start_date.
-
#start_times ⇒ Object
readonly
Returns the value of attribute start_times.
-
#term ⇒ Object
readonly
Returns the value of attribute term.
Class Method Summary collapse
Instance Method Summary collapse
- #formatted_end_date(format = "%b %-d") ⇒ Object
- #formatted_instructors(options = {:linked => true }) ⇒ Object
- #formatted_location ⇒ Object
- #formatted_meeting_days ⇒ Object
- #formatted_start_date(format = "%b %-d") ⇒ Object
- #formatted_term ⇒ Object
-
#initialize(json) ⇒ Section
constructor
A new instance of Section.
Constructor Details
#initialize(json) ⇒ Section
Returns a new instance of Section.
46 47 48 49 50 |
# File 'lib/regis/responses/models/section.rb', line 46 def initialize(json) super(json) @instructors = parse(@instructors, Instructor) end |
Instance Attribute Details
#audits_long_name ⇒ Object (readonly)
Returns the value of attribute audits_long_name.
40 41 42 |
# File 'lib/regis/responses/models/section.rb', line 40 def audits_long_name @audits_long_name end |
#corequisites ⇒ Object (readonly)
Returns the value of attribute corequisites.
21 22 23 |
# File 'lib/regis/responses/models/section.rb', line 21 def corequisites @corequisites end |
#course_description ⇒ Object (readonly)
Returns the value of attribute course_description.
10 11 12 |
# File 'lib/regis/responses/models/section.rb', line 10 def course_description @course_description end |
#course_name ⇒ Object (readonly)
Returns the value of attribute course_name.
9 10 11 |
# File 'lib/regis/responses/models/section.rb', line 9 def course_name @course_name end |
#course_title ⇒ Object (readonly)
Returns the value of attribute course_title.
11 12 13 |
# File 'lib/regis/responses/models/section.rb', line 11 def course_title @course_title end |
#credits_long_name ⇒ Object (readonly)
Returns the value of attribute credits_long_name.
41 42 43 |
# File 'lib/regis/responses/models/section.rb', line 41 def credits_long_name @credits_long_name end |
#current_status ⇒ Object (readonly)
Returns the value of attribute current_status.
23 24 25 |
# File 'lib/regis/responses/models/section.rb', line 23 def current_status @current_status end |
#end_date ⇒ Object (readonly)
Returns the value of attribute end_date.
26 27 28 |
# File 'lib/regis/responses/models/section.rb', line 26 def end_date @end_date end |
#end_times ⇒ Object (readonly)
Returns the value of attribute end_times.
29 30 31 |
# File 'lib/regis/responses/models/section.rb', line 29 def end_times @end_times end |
#instructors ⇒ Object (readonly)
Returns the value of attribute instructors.
44 45 46 |
# File 'lib/regis/responses/models/section.rb', line 44 def instructors @instructors end |
#is_audio ⇒ Object (readonly)
Returns the value of attribute is_audio.
17 18 19 |
# File 'lib/regis/responses/models/section.rb', line 17 def is_audio @is_audio end |
#is_evening ⇒ Object (readonly)
Returns the value of attribute is_evening.
33 34 35 |
# File 'lib/regis/responses/models/section.rb', line 33 def is_evening @is_evening end |
#is_oncampus ⇒ Object (readonly)
Returns the value of attribute is_oncampus.
18 19 20 |
# File 'lib/regis/responses/models/section.rb', line 18 def is_oncampus @is_oncampus end |
#is_pass_fail ⇒ Object (readonly)
Returns the value of attribute is_pass_fail.
42 43 44 |
# File 'lib/regis/responses/models/section.rb', line 42 def is_pass_fail @is_pass_fail end |
#is_unlisted ⇒ Object (readonly)
Returns the value of attribute is_unlisted.
36 37 38 |
# File 'lib/regis/responses/models/section.rb', line 36 def is_unlisted @is_unlisted end |
#is_waitlist ⇒ Object (readonly)
Returns the value of attribute is_waitlist.
34 35 36 |
# File 'lib/regis/responses/models/section.rb', line 34 def is_waitlist @is_waitlist end |
#is_weekday ⇒ Object (readonly)
Returns the value of attribute is_weekday.
32 33 34 |
# File 'lib/regis/responses/models/section.rb', line 32 def is_weekday @is_weekday end |
#is_weekend ⇒ Object (readonly)
Returns the value of attribute is_weekend.
31 32 33 |
# File 'lib/regis/responses/models/section.rb', line 31 def is_weekend @is_weekend end |
#location_code ⇒ Object (readonly)
Returns the value of attribute location_code.
13 14 15 |
# File 'lib/regis/responses/models/section.rb', line 13 def location_code @location_code end |
#location_long_name ⇒ Object (readonly)
Returns the value of attribute location_long_name.
14 15 16 |
# File 'lib/regis/responses/models/section.rb', line 14 def location_long_name @location_long_name end |
#meeting_days ⇒ Object (readonly)
Returns the value of attribute meeting_days.
27 28 29 |
# File 'lib/regis/responses/models/section.rb', line 27 def meeting_days @meeting_days end |
#prerequisites ⇒ Object (readonly)
Returns the value of attribute prerequisites.
20 21 22 |
# File 'lib/regis/responses/models/section.rb', line 20 def prerequisites @prerequisites end |
#reporting_term ⇒ Object (readonly)
Returns the value of attribute reporting_term.
38 39 40 |
# File 'lib/regis/responses/models/section.rb', line 38 def reporting_term @reporting_term end |
#room ⇒ Object (readonly)
Returns the value of attribute room.
15 16 17 |
# File 'lib/regis/responses/models/section.rb', line 15 def room @room end |
#section_code ⇒ Object (readonly)
Returns the value of attribute section_code.
12 13 14 |
# File 'lib/regis/responses/models/section.rb', line 12 def section_code @section_code end |
#secUUID ⇒ Object (readonly)
Returns the value of attribute secUUID.
8 9 10 |
# File 'lib/regis/responses/models/section.rb', line 8 def secUUID @secUUID end |
#start_date ⇒ Object (readonly)
Returns the value of attribute start_date.
25 26 27 |
# File 'lib/regis/responses/models/section.rb', line 25 def start_date @start_date end |
#start_times ⇒ Object (readonly)
Returns the value of attribute start_times.
28 29 30 |
# File 'lib/regis/responses/models/section.rb', line 28 def start_times @start_times end |
#term ⇒ Object (readonly)
Returns the value of attribute term.
39 40 41 |
# File 'lib/regis/responses/models/section.rb', line 39 def term @term end |
Class Method Details
.formatted_location(value) ⇒ Object
88 89 90 |
# File 'lib/regis/responses/models/section.rb', line 88 def self.formatted_location(value) return value.gsub("VAN"," Vancouver").gsub("AUDIO", " Distance").gsub("PARA", " Para-church").gsub("IV", " Intervarsity").gsub("SKAG", " Skagit Valley").gsub("KENYA", " Kenya").gsub("CAM", " Costa Rica").gsub("EU", " France").gsub("ME", " Israel & Palestine") end |
.formatted_term(value) ⇒ Object
76 77 78 |
# File 'lib/regis/responses/models/section.rb', line 76 def self.formatted_term(value) return value.gsub("WI"," Winter Term").gsub("SUR"," Summer Term").gsub("SU", " Summer (Distance)").gsub("FA"," Fall Term").gsub("SP", " Spring Session").gsub("SS", " Summer Session") end |
Instance Method Details
#formatted_end_date(format = "%b %-d") ⇒ Object
72 73 74 |
# File 'lib/regis/responses/models/section.rb', line 72 def formatted_end_date(format="%b %-d") DateTime.strptime(@end_date,"%Y-%m-%dT%H:%M:%S").strftime(format) end |
#formatted_instructors(options = {:linked => true }) ⇒ Object
96 97 98 99 100 101 102 |
# File 'lib/regis/responses/models/section.rb', line 96 def formatted_instructors( = {:linked => true }) ret = Array.new for i in self.instructors ret << "#{i.full_name} " end return ret end |
#formatted_location ⇒ Object
92 93 94 |
# File 'lib/regis/responses/models/section.rb', line 92 def formatted_location self.location_code.present?? Section.formatted_location(self.location_code) : "" end |
#formatted_meeting_days ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/regis/responses/models/section.rb', line 52 def formatted_meeting_days if self.meeting_days == "Monday Tuesday Wednesday Thursday Friday Saturday Sunday" return "Monday to Sunday" end if self.meeting_days == "Monday Tuesday Wednesday Thursday Friday" return "Monday to Friday" end if self.meeting_days == "Monday Tuesday Wednesday Thursday" return "Monday to Thursday" end if self.meeting_days == "Wednesday Thursday Friday" return "Wednesday to Friday" end return self.meeting_days end |
#formatted_start_date(format = "%b %-d") ⇒ Object
68 69 70 |
# File 'lib/regis/responses/models/section.rb', line 68 def formatted_start_date(format="%b %-d") DateTime.strptime(@start_date,"%Y-%m-%dT%H:%M:%S").strftime(format) end |
#formatted_term ⇒ Object
80 81 82 83 84 85 86 |
# File 'lib/regis/responses/models/section.rb', line 80 def formatted_term if self.term["SU"] and self.location_code["VAN"] Section.formatted_term(self.term.gsub("SU","SUR")) # on-campus "SU" courses are guided studies, theses, major projects, etc. Term needs to not translate as Distance. else Section.formatted_term(self.term) end end |