Class: Verso::Course

Inherits:
Base
  • Object
show all
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.

Note:

Any attributes may be set upon instantiation, using Options Hash. The following are required:

Options Hash (attrs):

  • :code (String)

    Course code Required

  • :edition (String)

    Edition year Required

See Also:

Instance Attribute Summary collapse

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

attr_reader, #initialize

Constructor Details

This class inherits a constructor from Verso::Base

Instance Attribute Details

#co_opBoolean (readonly) Also known as: co_op?

Returns Is this a co-op course?.

Returns:

  • (Boolean)

    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 related_resources.include?("extras")
                  ExtrasList.new(:code => code, :edition => edition)
                else
                  []
                end
  end

  # @return [Verso:Frontmatter]
  def frontmatter
    @frontmatter ||= if self.related_resources.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
    @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.related_resources.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

#codeString (readonly)

Returns Course code.

Returns:

  • (String)

    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 related_resources.include?("extras")
                  ExtrasList.new(:code => code, :edition => edition)
                else
                  []
                end
  end

  # @return [Verso:Frontmatter]
  def frontmatter
    @frontmatter ||= if self.related_resources.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
    @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.related_resources.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

#complementBoolean (readonly) Also known as: complement?

Returns Is this a complementary course?.

Returns:

  • (Boolean)

    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 related_resources.include?("extras")
                  ExtrasList.new(:code => code, :edition => edition)
                else
                  []
                end
  end

  # @return [Verso:Frontmatter]
  def frontmatter
    @frontmatter ||= if self.related_resources.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
    @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.related_resources.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

#descriptionString (readonly)

Returns HTML-formatted course description.

Returns:

  • (String)

    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 related_resources.include?("extras")
                  ExtrasList.new(:code => code, :edition => edition)
                else
                  []
                end
  end

  # @return [Verso:Frontmatter]
  def frontmatter
    @frontmatter ||= if self.related_resources.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
    @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.related_resources.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

#durationFixnum (readonly)

Returns Course duration in weeks.

Returns:

  • (Fixnum)

    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 related_resources.include?("extras")
                  ExtrasList.new(:code => code, :edition => edition)
                else
                  []
                end
  end

  # @return [Verso:Frontmatter]
  def frontmatter
    @frontmatter ||= if self.related_resources.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
    @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.related_resources.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

#editionString (readonly)

Returns Edition year.

Returns:

  • (String)

    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 related_resources.include?("extras")
                  ExtrasList.new(:code => code, :edition => edition)
                else
                  []
                end
  end

  # @return [Verso:Frontmatter]
  def frontmatter
    @frontmatter ||= if self.related_resources.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
    @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.related_resources.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_levelsString (readonly)

Returns Space-separated list of recommended grade levels.

Returns:

  • (String)

    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 related_resources.include?("extras")
                  ExtrasList.new(:code => code, :edition => edition)
                else
                  []
                end
  end

  # @return [Verso:Frontmatter]
  def frontmatter
    @frontmatter ||= if self.related_resources.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
    @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.related_resources.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

#hoursnil, Fixnum (readonly)

Returns Course hours.

Returns:

  • (nil, Fixnum)

    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 related_resources.include?("extras")
                  ExtrasList.new(:code => code, :edition => edition)
                else
                  []
                end
  end

  # @return [Verso:Frontmatter]
  def frontmatter
    @frontmatter ||= if self.related_resources.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
    @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.related_resources.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_msBoolean (readonly) Also known as: hs_credit_in_ms?

Returns High school credit in middle school?.

Returns:

  • (Boolean)

    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 related_resources.include?("extras")
                  ExtrasList.new(:code => code, :edition => edition)
                else
                  []
                end
  end

  # @return [Verso:Frontmatter]
  def frontmatter
    @frontmatter ||= if self.related_resources.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
    @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.related_resources.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_exemptBoolean (readonly) Also known as: osha_exempt?

Returns Is this course exempt from the OSHA memo?.

Returns:

  • (Boolean)

    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 related_resources.include?("extras")
                  ExtrasList.new(:code => code, :edition => edition)
                else
                  []
                end
  end

  # @return [Verso:Frontmatter]
  def frontmatter
    @frontmatter ||= if self.related_resources.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
    @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.related_resources.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

Returns Array of strings specifying related resources.

Returns:

  • (Array)

    Array of strings specifying related resources

See Also:



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 related_resources.include?("extras")
                  ExtrasList.new(:code => code, :edition => edition)
                else
                  []
                end
  end

  # @return [Verso:Frontmatter]
  def frontmatter
    @frontmatter ||= if self.related_resources.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
    @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.related_resources.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

#titleString (readonly)

Returns Course title.

Returns:

  • (String)

    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 related_resources.include?("extras")
                  ExtrasList.new(:code => code, :edition => edition)
                else
                  []
                end
  end

  # @return [Verso:Frontmatter]
  def frontmatter
    @frontmatter ||= if self.related_resources.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
    @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.related_resources.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

#certificationsArray

Returns Collection of certification Verso::Credential objects.

Returns:



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

def certifications
  @certfications ||= credentials.select { |c| c.type == "Certification" }
end

#credentialsArray

Returns Collection of Verso::Credential objects.

Returns:



56
57
58
# File 'lib/verso/course.rb', line 56

def credentials
  @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) }
end

#duty_areasVerso::TaskList Also known as: tasklist

Returns TaskList is a collection of DutyArea objects.

Returns:



62
63
64
# File 'lib/verso/course.rb', line 62

def duty_areas
  @duty_areas ||= TaskList.new(:code => code, :edition => edition)
end

#extrasVerso::ExtrasList

Returns:



68
69
70
71
72
73
74
# File 'lib/verso/course.rb', line 68

def extras
  @extras ||= if related_resources.include?("extras")
                ExtrasList.new(:code => code, :edition => edition)
              else
                []
              end
end

#frontmatterVerso:Frontmatter

Returns:

  • (Verso:Frontmatter)


77
78
79
80
81
82
83
# File 'lib/verso/course.rb', line 77

def frontmatter
  @frontmatter ||= if self.related_resources.include?("frontmatter")
                     Frontmatter.new("code" => code, "edition" => edition)
                   else
                     nil
                   end
end

#is_hs?Boolean

Returns is this a high school course?.

Returns:

  • (Boolean)

    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?.

Returns:

  • (Boolean)

    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

#licensesArray

Returns Colection of license Verso::Credential objects.

Returns:



96
97
98
# File 'lib/verso/course.rb', line 96

def licenses
  @licenses ||= credentials.select { |c| c.type == "License" }
end

#occupation_dataArray

Returns Collection of OccupationData objects.

Returns:



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_coursesArray Also known as: prerequisites

Returns Collection of prerequisite Verso::Course objects.

Returns:



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

Returns Collection of related Verso::Course objects forming sequences with this course.

Returns:

  • (Array)

    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
  @related_courses ||= get_attr(:related_courses).
                         collect { |c| Course.new(c) }
end

#standardsVerso::StandardsList

Returns Standards bodies correlated to this course’s tasks.

Returns:



122
123
124
125
126
127
128
129
# File 'lib/verso/course.rb', line 122

def standards
  @standards ||= if self.related_resources.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.

Parameters:

  • tid (Fixnum)

    The task id

Returns:



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