Class: Verso::Course
- Includes:
- HTTPGettable
- Defined in:
- lib/verso/course.rb
Overview
Course Resource
The chief container of Virginia CTE course data and the *parent of curriculum data.
Instance Attribute Summary collapse
-
#co_op ⇒ Boolean
(also: #co_op?)
readonly
Is this a co-op course?.
-
#code ⇒ String
readonly
Course code.
-
#complement ⇒ Boolean
(also: #complement?)
readonly
Is this a complementary course?.
-
#description ⇒ String
readonly
HTML-formatted course description.
-
#duration ⇒ Fixnum
readonly
Course duration in weeks.
-
#edition ⇒ String
readonly
Edition year.
-
#grade_levels ⇒ String
readonly
Space-separated list of recommended grade levels.
-
#hours ⇒ nil, Fixnum
readonly
Course hours.
-
#hs_credit_in_ms ⇒ Boolean
(also: #hs_credit_in_ms?)
readonly
High school credit in middle school?.
-
#osha_exempt ⇒ Boolean
(also: #osha_exempt?)
readonly
Is this course exempt from the OSHA memo?.
-
#related_resources ⇒ Array
readonly
Array of strings specifying related resources.
-
#title ⇒ String
readonly
Course title.
Attributes inherited from Base
Instance Method Summary collapse
-
#certifications ⇒ Array
Collection of certification Credential objects.
-
#credentials ⇒ Array
Collection of Credential objects.
-
#duty_areas ⇒ Verso::TaskList
(also: #tasklist)
TaskList is a collection of DutyArea objects.
- #extras ⇒ Verso::ExtrasList
- #frontmatter ⇒ Verso:Frontmatter
-
#is_hs? ⇒ Boolean
Is this a high school course?.
-
#is_ms? ⇒ Boolean
Is this a middle school course?.
-
#licenses ⇒ Array
Colection of license Credential objects.
-
#notes ⇒ String
HTML-formatted course notes.
-
#occupation_data ⇒ Array
Collection of OccupationData objects.
-
#prerequisite_courses ⇒ Array
(also: #prerequisites)
Collection of prerequisite Course objects.
-
#related_courses ⇒ Array
Collection of related Course objects forming sequences with this course.
-
#standards ⇒ Verso::StandardsList
Standards bodies correlated to this course’s tasks.
-
#task(tid) ⇒ Verso::Task
Fetch a complete task given a task id.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Verso::Base
Instance Attribute Details
#co_op ⇒ Boolean (readonly) Also known as: co_op?
Returns Is this a co-op course?.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/verso/course.rb', line 40 class Course < Verso::Base include HTTPGettable attr_reader :co_op, :code, :complement, :description, :duration, :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt, :related_resources, :title alias co_op? co_op alias complement? complement alias hs_credit_in_ms? hs_credit_in_ms alias osha_exempt? osha_exempt # @return [String] HTML-formatted course notes def notes get_attr(:notes).to_s end # @return [Array] Collection of certification {Verso::Credential} objects def certifications @certfications ||= credentials.select { |c| c.type == "Certification" } end # @return [Array] Collection of {Verso::Credential} objects def credentials @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) } end # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea} # objects. def duty_areas @duty_areas ||= TaskList.new(:code => code, :edition => edition) end alias tasklist duty_areas # @return [Verso::ExtrasList] def extras @extras ||= if .include?("extras") ExtrasList.new(:code => code, :edition => edition) else [] end end # @return [Verso:Frontmatter] def frontmatter @frontmatter ||= if self..include?("frontmatter") Frontmatter.new("code" => code, "edition" => edition) else nil end end # @return [Boolean] Is this a middle school course? def is_ms? grade_levels.split.first.to_i < 9 end # @return [Boolean] is this a high school course? def is_hs? grade_levels.split.last.to_i > 8 end # @return [Array] Colection of license {Verso::Credential} objects def licenses @licenses ||= credentials.select { |c| c.type == "License" } end # @return [Array] Collection of prerequisite {Verso::Course} objects def prerequisite_courses @prerequisites ||= get_attr(:prerequisite_courses). collect { |c| Course.new(c) } end alias prerequisites prerequisite_courses # @return [Array] Collection of {Verso::OccupationData} objects def occupation_data @occupation_data ||= get_attr(:occupation_data). collect { |od| OccupationData.new(od) } end # @return [Array] Collection of related {Verso::Course} objects # forming sequences with this course. def @related_courses ||= get_attr(:related_courses). collect { |c| Course.new(c) } end # @return [Verso::StandardsList] Standards bodies correlated to this # course's tasks. def standards @standards ||= StandardsList.from_course(self) end # Fetch a complete task given a task id. # # @param [Fixnum] tid The task id # @return [Verso::Task] def task(tid) @tasks ||= {} @tasks[tid] ||= Task.new("code" => code, "edition" => edition, "id" => tid) end private def path "/courses/#{code},#{edition}" end end |
#code ⇒ String (readonly)
Returns Course code.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/verso/course.rb', line 40 class Course < Verso::Base include HTTPGettable attr_reader :co_op, :code, :complement, :description, :duration, :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt, :related_resources, :title alias co_op? co_op alias complement? complement alias hs_credit_in_ms? hs_credit_in_ms alias osha_exempt? osha_exempt # @return [String] HTML-formatted course notes def notes get_attr(:notes).to_s end # @return [Array] Collection of certification {Verso::Credential} objects def certifications @certfications ||= credentials.select { |c| c.type == "Certification" } end # @return [Array] Collection of {Verso::Credential} objects def credentials @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) } end # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea} # objects. def duty_areas @duty_areas ||= TaskList.new(:code => code, :edition => edition) end alias tasklist duty_areas # @return [Verso::ExtrasList] def extras @extras ||= if .include?("extras") ExtrasList.new(:code => code, :edition => edition) else [] end end # @return [Verso:Frontmatter] def frontmatter @frontmatter ||= if self..include?("frontmatter") Frontmatter.new("code" => code, "edition" => edition) else nil end end # @return [Boolean] Is this a middle school course? def is_ms? grade_levels.split.first.to_i < 9 end # @return [Boolean] is this a high school course? def is_hs? grade_levels.split.last.to_i > 8 end # @return [Array] Colection of license {Verso::Credential} objects def licenses @licenses ||= credentials.select { |c| c.type == "License" } end # @return [Array] Collection of prerequisite {Verso::Course} objects def prerequisite_courses @prerequisites ||= get_attr(:prerequisite_courses). collect { |c| Course.new(c) } end alias prerequisites prerequisite_courses # @return [Array] Collection of {Verso::OccupationData} objects def occupation_data @occupation_data ||= get_attr(:occupation_data). collect { |od| OccupationData.new(od) } end # @return [Array] Collection of related {Verso::Course} objects # forming sequences with this course. def @related_courses ||= get_attr(:related_courses). collect { |c| Course.new(c) } end # @return [Verso::StandardsList] Standards bodies correlated to this # course's tasks. def standards @standards ||= StandardsList.from_course(self) end # Fetch a complete task given a task id. # # @param [Fixnum] tid The task id # @return [Verso::Task] def task(tid) @tasks ||= {} @tasks[tid] ||= Task.new("code" => code, "edition" => edition, "id" => tid) end private def path "/courses/#{code},#{edition}" end end |
#complement ⇒ Boolean (readonly) Also known as: complement?
Returns Is this a complementary course?.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/verso/course.rb', line 40 class Course < Verso::Base include HTTPGettable attr_reader :co_op, :code, :complement, :description, :duration, :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt, :related_resources, :title alias co_op? co_op alias complement? complement alias hs_credit_in_ms? hs_credit_in_ms alias osha_exempt? osha_exempt # @return [String] HTML-formatted course notes def notes get_attr(:notes).to_s end # @return [Array] Collection of certification {Verso::Credential} objects def certifications @certfications ||= credentials.select { |c| c.type == "Certification" } end # @return [Array] Collection of {Verso::Credential} objects def credentials @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) } end # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea} # objects. def duty_areas @duty_areas ||= TaskList.new(:code => code, :edition => edition) end alias tasklist duty_areas # @return [Verso::ExtrasList] def extras @extras ||= if .include?("extras") ExtrasList.new(:code => code, :edition => edition) else [] end end # @return [Verso:Frontmatter] def frontmatter @frontmatter ||= if self..include?("frontmatter") Frontmatter.new("code" => code, "edition" => edition) else nil end end # @return [Boolean] Is this a middle school course? def is_ms? grade_levels.split.first.to_i < 9 end # @return [Boolean] is this a high school course? def is_hs? grade_levels.split.last.to_i > 8 end # @return [Array] Colection of license {Verso::Credential} objects def licenses @licenses ||= credentials.select { |c| c.type == "License" } end # @return [Array] Collection of prerequisite {Verso::Course} objects def prerequisite_courses @prerequisites ||= get_attr(:prerequisite_courses). collect { |c| Course.new(c) } end alias prerequisites prerequisite_courses # @return [Array] Collection of {Verso::OccupationData} objects def occupation_data @occupation_data ||= get_attr(:occupation_data). collect { |od| OccupationData.new(od) } end # @return [Array] Collection of related {Verso::Course} objects # forming sequences with this course. def @related_courses ||= get_attr(:related_courses). collect { |c| Course.new(c) } end # @return [Verso::StandardsList] Standards bodies correlated to this # course's tasks. def standards @standards ||= StandardsList.from_course(self) end # Fetch a complete task given a task id. # # @param [Fixnum] tid The task id # @return [Verso::Task] def task(tid) @tasks ||= {} @tasks[tid] ||= Task.new("code" => code, "edition" => edition, "id" => tid) end private def path "/courses/#{code},#{edition}" end end |
#description ⇒ String (readonly)
Returns HTML-formatted course description.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/verso/course.rb', line 40 class Course < Verso::Base include HTTPGettable attr_reader :co_op, :code, :complement, :description, :duration, :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt, :related_resources, :title alias co_op? co_op alias complement? complement alias hs_credit_in_ms? hs_credit_in_ms alias osha_exempt? osha_exempt # @return [String] HTML-formatted course notes def notes get_attr(:notes).to_s end # @return [Array] Collection of certification {Verso::Credential} objects def certifications @certfications ||= credentials.select { |c| c.type == "Certification" } end # @return [Array] Collection of {Verso::Credential} objects def credentials @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) } end # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea} # objects. def duty_areas @duty_areas ||= TaskList.new(:code => code, :edition => edition) end alias tasklist duty_areas # @return [Verso::ExtrasList] def extras @extras ||= if .include?("extras") ExtrasList.new(:code => code, :edition => edition) else [] end end # @return [Verso:Frontmatter] def frontmatter @frontmatter ||= if self..include?("frontmatter") Frontmatter.new("code" => code, "edition" => edition) else nil end end # @return [Boolean] Is this a middle school course? def is_ms? grade_levels.split.first.to_i < 9 end # @return [Boolean] is this a high school course? def is_hs? grade_levels.split.last.to_i > 8 end # @return [Array] Colection of license {Verso::Credential} objects def licenses @licenses ||= credentials.select { |c| c.type == "License" } end # @return [Array] Collection of prerequisite {Verso::Course} objects def prerequisite_courses @prerequisites ||= get_attr(:prerequisite_courses). collect { |c| Course.new(c) } end alias prerequisites prerequisite_courses # @return [Array] Collection of {Verso::OccupationData} objects def occupation_data @occupation_data ||= get_attr(:occupation_data). collect { |od| OccupationData.new(od) } end # @return [Array] Collection of related {Verso::Course} objects # forming sequences with this course. def @related_courses ||= get_attr(:related_courses). collect { |c| Course.new(c) } end # @return [Verso::StandardsList] Standards bodies correlated to this # course's tasks. def standards @standards ||= StandardsList.from_course(self) end # Fetch a complete task given a task id. # # @param [Fixnum] tid The task id # @return [Verso::Task] def task(tid) @tasks ||= {} @tasks[tid] ||= Task.new("code" => code, "edition" => edition, "id" => tid) end private def path "/courses/#{code},#{edition}" end end |
#duration ⇒ Fixnum (readonly)
Returns Course duration in weeks.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/verso/course.rb', line 40 class Course < Verso::Base include HTTPGettable attr_reader :co_op, :code, :complement, :description, :duration, :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt, :related_resources, :title alias co_op? co_op alias complement? complement alias hs_credit_in_ms? hs_credit_in_ms alias osha_exempt? osha_exempt # @return [String] HTML-formatted course notes def notes get_attr(:notes).to_s end # @return [Array] Collection of certification {Verso::Credential} objects def certifications @certfications ||= credentials.select { |c| c.type == "Certification" } end # @return [Array] Collection of {Verso::Credential} objects def credentials @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) } end # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea} # objects. def duty_areas @duty_areas ||= TaskList.new(:code => code, :edition => edition) end alias tasklist duty_areas # @return [Verso::ExtrasList] def extras @extras ||= if .include?("extras") ExtrasList.new(:code => code, :edition => edition) else [] end end # @return [Verso:Frontmatter] def frontmatter @frontmatter ||= if self..include?("frontmatter") Frontmatter.new("code" => code, "edition" => edition) else nil end end # @return [Boolean] Is this a middle school course? def is_ms? grade_levels.split.first.to_i < 9 end # @return [Boolean] is this a high school course? def is_hs? grade_levels.split.last.to_i > 8 end # @return [Array] Colection of license {Verso::Credential} objects def licenses @licenses ||= credentials.select { |c| c.type == "License" } end # @return [Array] Collection of prerequisite {Verso::Course} objects def prerequisite_courses @prerequisites ||= get_attr(:prerequisite_courses). collect { |c| Course.new(c) } end alias prerequisites prerequisite_courses # @return [Array] Collection of {Verso::OccupationData} objects def occupation_data @occupation_data ||= get_attr(:occupation_data). collect { |od| OccupationData.new(od) } end # @return [Array] Collection of related {Verso::Course} objects # forming sequences with this course. def @related_courses ||= get_attr(:related_courses). collect { |c| Course.new(c) } end # @return [Verso::StandardsList] Standards bodies correlated to this # course's tasks. def standards @standards ||= StandardsList.from_course(self) end # Fetch a complete task given a task id. # # @param [Fixnum] tid The task id # @return [Verso::Task] def task(tid) @tasks ||= {} @tasks[tid] ||= Task.new("code" => code, "edition" => edition, "id" => tid) end private def path "/courses/#{code},#{edition}" end end |
#edition ⇒ String (readonly)
Returns Edition year.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/verso/course.rb', line 40 class Course < Verso::Base include HTTPGettable attr_reader :co_op, :code, :complement, :description, :duration, :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt, :related_resources, :title alias co_op? co_op alias complement? complement alias hs_credit_in_ms? hs_credit_in_ms alias osha_exempt? osha_exempt # @return [String] HTML-formatted course notes def notes get_attr(:notes).to_s end # @return [Array] Collection of certification {Verso::Credential} objects def certifications @certfications ||= credentials.select { |c| c.type == "Certification" } end # @return [Array] Collection of {Verso::Credential} objects def credentials @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) } end # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea} # objects. def duty_areas @duty_areas ||= TaskList.new(:code => code, :edition => edition) end alias tasklist duty_areas # @return [Verso::ExtrasList] def extras @extras ||= if .include?("extras") ExtrasList.new(:code => code, :edition => edition) else [] end end # @return [Verso:Frontmatter] def frontmatter @frontmatter ||= if self..include?("frontmatter") Frontmatter.new("code" => code, "edition" => edition) else nil end end # @return [Boolean] Is this a middle school course? def is_ms? grade_levels.split.first.to_i < 9 end # @return [Boolean] is this a high school course? def is_hs? grade_levels.split.last.to_i > 8 end # @return [Array] Colection of license {Verso::Credential} objects def licenses @licenses ||= credentials.select { |c| c.type == "License" } end # @return [Array] Collection of prerequisite {Verso::Course} objects def prerequisite_courses @prerequisites ||= get_attr(:prerequisite_courses). collect { |c| Course.new(c) } end alias prerequisites prerequisite_courses # @return [Array] Collection of {Verso::OccupationData} objects def occupation_data @occupation_data ||= get_attr(:occupation_data). collect { |od| OccupationData.new(od) } end # @return [Array] Collection of related {Verso::Course} objects # forming sequences with this course. def @related_courses ||= get_attr(:related_courses). collect { |c| Course.new(c) } end # @return [Verso::StandardsList] Standards bodies correlated to this # course's tasks. def standards @standards ||= StandardsList.from_course(self) end # Fetch a complete task given a task id. # # @param [Fixnum] tid The task id # @return [Verso::Task] def task(tid) @tasks ||= {} @tasks[tid] ||= Task.new("code" => code, "edition" => edition, "id" => tid) end private def path "/courses/#{code},#{edition}" end end |
#grade_levels ⇒ String (readonly)
Returns Space-separated list of recommended grade levels.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/verso/course.rb', line 40 class Course < Verso::Base include HTTPGettable attr_reader :co_op, :code, :complement, :description, :duration, :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt, :related_resources, :title alias co_op? co_op alias complement? complement alias hs_credit_in_ms? hs_credit_in_ms alias osha_exempt? osha_exempt # @return [String] HTML-formatted course notes def notes get_attr(:notes).to_s end # @return [Array] Collection of certification {Verso::Credential} objects def certifications @certfications ||= credentials.select { |c| c.type == "Certification" } end # @return [Array] Collection of {Verso::Credential} objects def credentials @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) } end # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea} # objects. def duty_areas @duty_areas ||= TaskList.new(:code => code, :edition => edition) end alias tasklist duty_areas # @return [Verso::ExtrasList] def extras @extras ||= if .include?("extras") ExtrasList.new(:code => code, :edition => edition) else [] end end # @return [Verso:Frontmatter] def frontmatter @frontmatter ||= if self..include?("frontmatter") Frontmatter.new("code" => code, "edition" => edition) else nil end end # @return [Boolean] Is this a middle school course? def is_ms? grade_levels.split.first.to_i < 9 end # @return [Boolean] is this a high school course? def is_hs? grade_levels.split.last.to_i > 8 end # @return [Array] Colection of license {Verso::Credential} objects def licenses @licenses ||= credentials.select { |c| c.type == "License" } end # @return [Array] Collection of prerequisite {Verso::Course} objects def prerequisite_courses @prerequisites ||= get_attr(:prerequisite_courses). collect { |c| Course.new(c) } end alias prerequisites prerequisite_courses # @return [Array] Collection of {Verso::OccupationData} objects def occupation_data @occupation_data ||= get_attr(:occupation_data). collect { |od| OccupationData.new(od) } end # @return [Array] Collection of related {Verso::Course} objects # forming sequences with this course. def @related_courses ||= get_attr(:related_courses). collect { |c| Course.new(c) } end # @return [Verso::StandardsList] Standards bodies correlated to this # course's tasks. def standards @standards ||= StandardsList.from_course(self) end # Fetch a complete task given a task id. # # @param [Fixnum] tid The task id # @return [Verso::Task] def task(tid) @tasks ||= {} @tasks[tid] ||= Task.new("code" => code, "edition" => edition, "id" => tid) end private def path "/courses/#{code},#{edition}" end end |
#hours ⇒ nil, Fixnum (readonly)
Returns Course hours.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/verso/course.rb', line 40 class Course < Verso::Base include HTTPGettable attr_reader :co_op, :code, :complement, :description, :duration, :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt, :related_resources, :title alias co_op? co_op alias complement? complement alias hs_credit_in_ms? hs_credit_in_ms alias osha_exempt? osha_exempt # @return [String] HTML-formatted course notes def notes get_attr(:notes).to_s end # @return [Array] Collection of certification {Verso::Credential} objects def certifications @certfications ||= credentials.select { |c| c.type == "Certification" } end # @return [Array] Collection of {Verso::Credential} objects def credentials @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) } end # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea} # objects. def duty_areas @duty_areas ||= TaskList.new(:code => code, :edition => edition) end alias tasklist duty_areas # @return [Verso::ExtrasList] def extras @extras ||= if .include?("extras") ExtrasList.new(:code => code, :edition => edition) else [] end end # @return [Verso:Frontmatter] def frontmatter @frontmatter ||= if self..include?("frontmatter") Frontmatter.new("code" => code, "edition" => edition) else nil end end # @return [Boolean] Is this a middle school course? def is_ms? grade_levels.split.first.to_i < 9 end # @return [Boolean] is this a high school course? def is_hs? grade_levels.split.last.to_i > 8 end # @return [Array] Colection of license {Verso::Credential} objects def licenses @licenses ||= credentials.select { |c| c.type == "License" } end # @return [Array] Collection of prerequisite {Verso::Course} objects def prerequisite_courses @prerequisites ||= get_attr(:prerequisite_courses). collect { |c| Course.new(c) } end alias prerequisites prerequisite_courses # @return [Array] Collection of {Verso::OccupationData} objects def occupation_data @occupation_data ||= get_attr(:occupation_data). collect { |od| OccupationData.new(od) } end # @return [Array] Collection of related {Verso::Course} objects # forming sequences with this course. def @related_courses ||= get_attr(:related_courses). collect { |c| Course.new(c) } end # @return [Verso::StandardsList] Standards bodies correlated to this # course's tasks. def standards @standards ||= StandardsList.from_course(self) end # Fetch a complete task given a task id. # # @param [Fixnum] tid The task id # @return [Verso::Task] def task(tid) @tasks ||= {} @tasks[tid] ||= Task.new("code" => code, "edition" => edition, "id" => tid) end private def path "/courses/#{code},#{edition}" end end |
#hs_credit_in_ms ⇒ Boolean (readonly) Also known as: hs_credit_in_ms?
Returns High school credit in middle school?.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/verso/course.rb', line 40 class Course < Verso::Base include HTTPGettable attr_reader :co_op, :code, :complement, :description, :duration, :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt, :related_resources, :title alias co_op? co_op alias complement? complement alias hs_credit_in_ms? hs_credit_in_ms alias osha_exempt? osha_exempt # @return [String] HTML-formatted course notes def notes get_attr(:notes).to_s end # @return [Array] Collection of certification {Verso::Credential} objects def certifications @certfications ||= credentials.select { |c| c.type == "Certification" } end # @return [Array] Collection of {Verso::Credential} objects def credentials @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) } end # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea} # objects. def duty_areas @duty_areas ||= TaskList.new(:code => code, :edition => edition) end alias tasklist duty_areas # @return [Verso::ExtrasList] def extras @extras ||= if .include?("extras") ExtrasList.new(:code => code, :edition => edition) else [] end end # @return [Verso:Frontmatter] def frontmatter @frontmatter ||= if self..include?("frontmatter") Frontmatter.new("code" => code, "edition" => edition) else nil end end # @return [Boolean] Is this a middle school course? def is_ms? grade_levels.split.first.to_i < 9 end # @return [Boolean] is this a high school course? def is_hs? grade_levels.split.last.to_i > 8 end # @return [Array] Colection of license {Verso::Credential} objects def licenses @licenses ||= credentials.select { |c| c.type == "License" } end # @return [Array] Collection of prerequisite {Verso::Course} objects def prerequisite_courses @prerequisites ||= get_attr(:prerequisite_courses). collect { |c| Course.new(c) } end alias prerequisites prerequisite_courses # @return [Array] Collection of {Verso::OccupationData} objects def occupation_data @occupation_data ||= get_attr(:occupation_data). collect { |od| OccupationData.new(od) } end # @return [Array] Collection of related {Verso::Course} objects # forming sequences with this course. def @related_courses ||= get_attr(:related_courses). collect { |c| Course.new(c) } end # @return [Verso::StandardsList] Standards bodies correlated to this # course's tasks. def standards @standards ||= StandardsList.from_course(self) end # Fetch a complete task given a task id. # # @param [Fixnum] tid The task id # @return [Verso::Task] def task(tid) @tasks ||= {} @tasks[tid] ||= Task.new("code" => code, "edition" => edition, "id" => tid) end private def path "/courses/#{code},#{edition}" end end |
#osha_exempt ⇒ Boolean (readonly) Also known as: osha_exempt?
Returns Is this course exempt from the OSHA memo?.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/verso/course.rb', line 40 class Course < Verso::Base include HTTPGettable attr_reader :co_op, :code, :complement, :description, :duration, :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt, :related_resources, :title alias co_op? co_op alias complement? complement alias hs_credit_in_ms? hs_credit_in_ms alias osha_exempt? osha_exempt # @return [String] HTML-formatted course notes def notes get_attr(:notes).to_s end # @return [Array] Collection of certification {Verso::Credential} objects def certifications @certfications ||= credentials.select { |c| c.type == "Certification" } end # @return [Array] Collection of {Verso::Credential} objects def credentials @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) } end # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea} # objects. def duty_areas @duty_areas ||= TaskList.new(:code => code, :edition => edition) end alias tasklist duty_areas # @return [Verso::ExtrasList] def extras @extras ||= if .include?("extras") ExtrasList.new(:code => code, :edition => edition) else [] end end # @return [Verso:Frontmatter] def frontmatter @frontmatter ||= if self..include?("frontmatter") Frontmatter.new("code" => code, "edition" => edition) else nil end end # @return [Boolean] Is this a middle school course? def is_ms? grade_levels.split.first.to_i < 9 end # @return [Boolean] is this a high school course? def is_hs? grade_levels.split.last.to_i > 8 end # @return [Array] Colection of license {Verso::Credential} objects def licenses @licenses ||= credentials.select { |c| c.type == "License" } end # @return [Array] Collection of prerequisite {Verso::Course} objects def prerequisite_courses @prerequisites ||= get_attr(:prerequisite_courses). collect { |c| Course.new(c) } end alias prerequisites prerequisite_courses # @return [Array] Collection of {Verso::OccupationData} objects def occupation_data @occupation_data ||= get_attr(:occupation_data). collect { |od| OccupationData.new(od) } end # @return [Array] Collection of related {Verso::Course} objects # forming sequences with this course. def @related_courses ||= get_attr(:related_courses). collect { |c| Course.new(c) } end # @return [Verso::StandardsList] Standards bodies correlated to this # course's tasks. def standards @standards ||= StandardsList.from_course(self) end # Fetch a complete task given a task id. # # @param [Fixnum] tid The task id # @return [Verso::Task] def task(tid) @tasks ||= {} @tasks[tid] ||= Task.new("code" => code, "edition" => edition, "id" => tid) end private def path "/courses/#{code},#{edition}" end end |
#related_resources ⇒ Array (readonly)
Returns Array of strings specifying related resources.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/verso/course.rb', line 40 class Course < Verso::Base include HTTPGettable attr_reader :co_op, :code, :complement, :description, :duration, :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt, :related_resources, :title alias co_op? co_op alias complement? complement alias hs_credit_in_ms? hs_credit_in_ms alias osha_exempt? osha_exempt # @return [String] HTML-formatted course notes def notes get_attr(:notes).to_s end # @return [Array] Collection of certification {Verso::Credential} objects def certifications @certfications ||= credentials.select { |c| c.type == "Certification" } end # @return [Array] Collection of {Verso::Credential} objects def credentials @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) } end # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea} # objects. def duty_areas @duty_areas ||= TaskList.new(:code => code, :edition => edition) end alias tasklist duty_areas # @return [Verso::ExtrasList] def extras @extras ||= if .include?("extras") ExtrasList.new(:code => code, :edition => edition) else [] end end # @return [Verso:Frontmatter] def frontmatter @frontmatter ||= if self..include?("frontmatter") Frontmatter.new("code" => code, "edition" => edition) else nil end end # @return [Boolean] Is this a middle school course? def is_ms? grade_levels.split.first.to_i < 9 end # @return [Boolean] is this a high school course? def is_hs? grade_levels.split.last.to_i > 8 end # @return [Array] Colection of license {Verso::Credential} objects def licenses @licenses ||= credentials.select { |c| c.type == "License" } end # @return [Array] Collection of prerequisite {Verso::Course} objects def prerequisite_courses @prerequisites ||= get_attr(:prerequisite_courses). collect { |c| Course.new(c) } end alias prerequisites prerequisite_courses # @return [Array] Collection of {Verso::OccupationData} objects def occupation_data @occupation_data ||= get_attr(:occupation_data). collect { |od| OccupationData.new(od) } end # @return [Array] Collection of related {Verso::Course} objects # forming sequences with this course. def @related_courses ||= get_attr(:related_courses). collect { |c| Course.new(c) } end # @return [Verso::StandardsList] Standards bodies correlated to this # course's tasks. def standards @standards ||= StandardsList.from_course(self) end # Fetch a complete task given a task id. # # @param [Fixnum] tid The task id # @return [Verso::Task] def task(tid) @tasks ||= {} @tasks[tid] ||= Task.new("code" => code, "edition" => edition, "id" => tid) end private def path "/courses/#{code},#{edition}" end end |
#title ⇒ String (readonly)
Returns Course title.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/verso/course.rb', line 40 class Course < Verso::Base include HTTPGettable attr_reader :co_op, :code, :complement, :description, :duration, :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt, :related_resources, :title alias co_op? co_op alias complement? complement alias hs_credit_in_ms? hs_credit_in_ms alias osha_exempt? osha_exempt # @return [String] HTML-formatted course notes def notes get_attr(:notes).to_s end # @return [Array] Collection of certification {Verso::Credential} objects def certifications @certfications ||= credentials.select { |c| c.type == "Certification" } end # @return [Array] Collection of {Verso::Credential} objects def credentials @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) } end # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea} # objects. def duty_areas @duty_areas ||= TaskList.new(:code => code, :edition => edition) end alias tasklist duty_areas # @return [Verso::ExtrasList] def extras @extras ||= if .include?("extras") ExtrasList.new(:code => code, :edition => edition) else [] end end # @return [Verso:Frontmatter] def frontmatter @frontmatter ||= if self..include?("frontmatter") Frontmatter.new("code" => code, "edition" => edition) else nil end end # @return [Boolean] Is this a middle school course? def is_ms? grade_levels.split.first.to_i < 9 end # @return [Boolean] is this a high school course? def is_hs? grade_levels.split.last.to_i > 8 end # @return [Array] Colection of license {Verso::Credential} objects def licenses @licenses ||= credentials.select { |c| c.type == "License" } end # @return [Array] Collection of prerequisite {Verso::Course} objects def prerequisite_courses @prerequisites ||= get_attr(:prerequisite_courses). collect { |c| Course.new(c) } end alias prerequisites prerequisite_courses # @return [Array] Collection of {Verso::OccupationData} objects def occupation_data @occupation_data ||= get_attr(:occupation_data). collect { |od| OccupationData.new(od) } end # @return [Array] Collection of related {Verso::Course} objects # forming sequences with this course. def @related_courses ||= get_attr(:related_courses). collect { |c| Course.new(c) } end # @return [Verso::StandardsList] Standards bodies correlated to this # course's tasks. def standards @standards ||= StandardsList.from_course(self) end # Fetch a complete task given a task id. # # @param [Fixnum] tid The task id # @return [Verso::Task] def task(tid) @tasks ||= {} @tasks[tid] ||= Task.new("code" => code, "edition" => edition, "id" => tid) end private def path "/courses/#{code},#{edition}" end end |
Instance Method Details
#certifications ⇒ Array
Returns Collection of certification Verso::Credential objects.
56 57 58 |
# File 'lib/verso/course.rb', line 56 def certifications @certfications ||= credentials.select { |c| c.type == "Certification" } end |
#credentials ⇒ Array
Returns Collection of Verso::Credential objects.
61 62 63 |
# File 'lib/verso/course.rb', line 61 def credentials @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) } end |
#duty_areas ⇒ Verso::TaskList Also known as: tasklist
Returns TaskList is a collection of DutyArea objects.
67 68 69 |
# File 'lib/verso/course.rb', line 67 def duty_areas @duty_areas ||= TaskList.new(:code => code, :edition => edition) end |
#extras ⇒ Verso::ExtrasList
73 74 75 76 77 78 79 |
# File 'lib/verso/course.rb', line 73 def extras @extras ||= if .include?("extras") ExtrasList.new(:code => code, :edition => edition) else [] end end |
#frontmatter ⇒ Verso:Frontmatter
82 83 84 85 86 87 88 |
# File 'lib/verso/course.rb', line 82 def frontmatter @frontmatter ||= if self..include?("frontmatter") Frontmatter.new("code" => code, "edition" => edition) else nil end end |
#is_hs? ⇒ Boolean
Returns is this a high school course?.
96 97 98 |
# File 'lib/verso/course.rb', line 96 def is_hs? grade_levels.split.last.to_i > 8 end |
#is_ms? ⇒ Boolean
Returns Is this a middle school course?.
91 92 93 |
# File 'lib/verso/course.rb', line 91 def is_ms? grade_levels.split.first.to_i < 9 end |
#licenses ⇒ Array
Returns Colection of license Verso::Credential objects.
101 102 103 |
# File 'lib/verso/course.rb', line 101 def licenses @licenses ||= credentials.select { |c| c.type == "License" } end |
#notes ⇒ String
Returns HTML-formatted course notes.
51 52 53 |
# File 'lib/verso/course.rb', line 51 def notes get_attr(:notes).to_s end |
#occupation_data ⇒ Array
Returns Collection of OccupationData objects.
113 114 115 116 |
# File 'lib/verso/course.rb', line 113 def occupation_data @occupation_data ||= get_attr(:occupation_data). collect { |od| OccupationData.new(od) } end |
#prerequisite_courses ⇒ Array Also known as: prerequisites
Returns Collection of prerequisite Verso::Course objects.
106 107 108 109 |
# File 'lib/verso/course.rb', line 106 def prerequisite_courses @prerequisites ||= get_attr(:prerequisite_courses). collect { |c| Course.new(c) } end |
#related_courses ⇒ Array
Returns Collection of related Verso::Course objects forming sequences with this course.
120 121 122 123 |
# File 'lib/verso/course.rb', line 120 def @related_courses ||= get_attr(:related_courses). collect { |c| Course.new(c) } end |
#standards ⇒ Verso::StandardsList
Returns Standards bodies correlated to this course’s tasks.
127 128 129 |
# File 'lib/verso/course.rb', line 127 def standards @standards ||= StandardsList.from_course(self) end |
#task(tid) ⇒ Verso::Task
Fetch a complete task given a task id.
135 136 137 138 139 |
# File 'lib/verso/course.rb', line 135 def task(tid) @tasks ||= {} @tasks[tid] ||= Task.new("code" => code, "edition" => edition, "id" => tid) end |