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.
-
#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 [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 ||= if self..include?("standards") StandardsList.from_course(self) else StandardsList.new(:code => code, :edition => edition, :standards => []) end 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 [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 ||= if self..include?("standards") StandardsList.from_course(self) else StandardsList.new(:code => code, :edition => edition, :standards => []) end 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 [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 ||= if self..include?("standards") StandardsList.from_course(self) else StandardsList.new(:code => code, :edition => edition, :standards => []) end 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 [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 ||= if self..include?("standards") StandardsList.from_course(self) else StandardsList.new(:code => code, :edition => edition, :standards => []) end 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 [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 ||= if self..include?("standards") StandardsList.from_course(self) else StandardsList.new(:code => code, :edition => edition, :standards => []) end 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 [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 ||= if self..include?("standards") StandardsList.from_course(self) else StandardsList.new(:code => code, :edition => edition, :standards => []) end 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 [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 ||= if self..include?("standards") StandardsList.from_course(self) else StandardsList.new(:code => code, :edition => edition, :standards => []) end 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 [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 ||= if self..include?("standards") StandardsList.from_course(self) else StandardsList.new(:code => code, :edition => edition, :standards => []) end 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 [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 ||= if self..include?("standards") StandardsList.from_course(self) else StandardsList.new(:code => code, :edition => edition, :standards => []) end 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 [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 ||= if self..include?("standards") StandardsList.from_course(self) else StandardsList.new(:code => code, :edition => edition, :standards => []) end 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 [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 ||= if self..include?("standards") StandardsList.from_course(self) else StandardsList.new(:code => code, :edition => edition, :standards => []) end 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 [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 ||= if self..include?("standards") StandardsList.from_course(self) else StandardsList.new(:code => code, :edition => edition, :standards => []) end 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.
51 52 53 |
# File 'lib/verso/course.rb', line 51 def certifications @certfications ||= credentials.select { |c| c.type == "Certification" } end |
#credentials ⇒ Array
Returns Collection of Verso::Credential objects.
56 57 58 |
# File 'lib/verso/course.rb', line 56 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.
62 63 64 |
# File 'lib/verso/course.rb', line 62 def duty_areas @duty_areas ||= TaskList.new(:code => code, :edition => edition) end |
#extras ⇒ Verso::ExtrasList
68 69 70 71 72 73 74 |
# File 'lib/verso/course.rb', line 68 def extras @extras ||= if .include?("extras") ExtrasList.new(:code => code, :edition => edition) else [] end end |
#frontmatter ⇒ Verso:Frontmatter
77 78 79 80 81 82 83 |
# File 'lib/verso/course.rb', line 77 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?.
91 92 93 |
# File 'lib/verso/course.rb', line 91 def is_hs? grade_levels.split.last.to_i > 8 end |
#is_ms? ⇒ Boolean
Returns Is this a middle school course?.
86 87 88 |
# File 'lib/verso/course.rb', line 86 def is_ms? grade_levels.split.first.to_i < 9 end |
#licenses ⇒ Array
Returns Colection of license Verso::Credential objects.
96 97 98 |
# File 'lib/verso/course.rb', line 96 def licenses @licenses ||= credentials.select { |c| c.type == "License" } end |
#occupation_data ⇒ Array
Returns Collection of OccupationData objects.
108 109 110 111 |
# File 'lib/verso/course.rb', line 108 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.
101 102 103 104 |
# File 'lib/verso/course.rb', line 101 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.
115 116 117 118 |
# File 'lib/verso/course.rb', line 115 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.
122 123 124 125 126 127 128 129 |
# File 'lib/verso/course.rb', line 122 def standards @standards ||= if self..include?("standards") StandardsList.from_course(self) else StandardsList.new(:code => code, :edition => edition, :standards => []) end 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 |