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?



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/verso/course.rb', line 40

class Course < Verso::Base
  include HTTPGettable
  attr_reader :co_op, :code, :complement, :description, :duration,
    :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt,
    :related_resources, :title
  alias co_op? co_op
  alias complement? complement
  alias hs_credit_in_ms? hs_credit_in_ms
  alias osha_exempt? osha_exempt

  # @return [String] HTML-formatted course notes
  def notes
    get_attr(:notes).to_s
  end

  # @return [Array] Collection of certification {Verso::Credential} objects
  def certifications
    @certfications ||= credentials.select { |c| c.type == "Certification" }
  end

  # @return [Array] Collection of {Verso::Credential} objects
  def credentials
    @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) }
  end

  # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea}
  #   objects.
  def duty_areas
    @duty_areas ||= TaskList.new(:code => code, :edition => edition)
  end
  alias tasklist duty_areas

  # @return [Verso::ExtrasList]
  def extras
    @extras ||= if 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 ||= StandardsList.from_course(self)
  end

  # Fetch a complete task given a task id.
  #
  # @param [Fixnum] tid The task id
  # @return [Verso::Task]
  def task(tid)
    @tasks ||= {}
    @tasks[tid] ||= Task.new("code" => code, "edition" => edition,
                             "id" => tid)
  end

private

  def path
    "/courses/#{code},#{edition}"
  end
end

#codeString (readonly)



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/verso/course.rb', line 40

class Course < Verso::Base
  include HTTPGettable
  attr_reader :co_op, :code, :complement, :description, :duration,
    :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt,
    :related_resources, :title
  alias co_op? co_op
  alias complement? complement
  alias hs_credit_in_ms? hs_credit_in_ms
  alias osha_exempt? osha_exempt

  # @return [String] HTML-formatted course notes
  def notes
    get_attr(:notes).to_s
  end

  # @return [Array] Collection of certification {Verso::Credential} objects
  def certifications
    @certfications ||= credentials.select { |c| c.type == "Certification" }
  end

  # @return [Array] Collection of {Verso::Credential} objects
  def credentials
    @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) }
  end

  # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea}
  #   objects.
  def duty_areas
    @duty_areas ||= TaskList.new(:code => code, :edition => edition)
  end
  alias tasklist duty_areas

  # @return [Verso::ExtrasList]
  def extras
    @extras ||= if 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 ||= StandardsList.from_course(self)
  end

  # Fetch a complete task given a task id.
  #
  # @param [Fixnum] tid The task id
  # @return [Verso::Task]
  def task(tid)
    @tasks ||= {}
    @tasks[tid] ||= Task.new("code" => code, "edition" => edition,
                             "id" => tid)
  end

private

  def path
    "/courses/#{code},#{edition}"
  end
end

#complementBoolean (readonly) Also known as: complement?



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/verso/course.rb', line 40

class Course < Verso::Base
  include HTTPGettable
  attr_reader :co_op, :code, :complement, :description, :duration,
    :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt,
    :related_resources, :title
  alias co_op? co_op
  alias complement? complement
  alias hs_credit_in_ms? hs_credit_in_ms
  alias osha_exempt? osha_exempt

  # @return [String] HTML-formatted course notes
  def notes
    get_attr(:notes).to_s
  end

  # @return [Array] Collection of certification {Verso::Credential} objects
  def certifications
    @certfications ||= credentials.select { |c| c.type == "Certification" }
  end

  # @return [Array] Collection of {Verso::Credential} objects
  def credentials
    @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) }
  end

  # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea}
  #   objects.
  def duty_areas
    @duty_areas ||= TaskList.new(:code => code, :edition => edition)
  end
  alias tasklist duty_areas

  # @return [Verso::ExtrasList]
  def extras
    @extras ||= if 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 ||= StandardsList.from_course(self)
  end

  # Fetch a complete task given a task id.
  #
  # @param [Fixnum] tid The task id
  # @return [Verso::Task]
  def task(tid)
    @tasks ||= {}
    @tasks[tid] ||= Task.new("code" => code, "edition" => edition,
                             "id" => tid)
  end

private

  def path
    "/courses/#{code},#{edition}"
  end
end

#descriptionString (readonly)



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/verso/course.rb', line 40

class Course < Verso::Base
  include HTTPGettable
  attr_reader :co_op, :code, :complement, :description, :duration,
    :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt,
    :related_resources, :title
  alias co_op? co_op
  alias complement? complement
  alias hs_credit_in_ms? hs_credit_in_ms
  alias osha_exempt? osha_exempt

  # @return [String] HTML-formatted course notes
  def notes
    get_attr(:notes).to_s
  end

  # @return [Array] Collection of certification {Verso::Credential} objects
  def certifications
    @certfications ||= credentials.select { |c| c.type == "Certification" }
  end

  # @return [Array] Collection of {Verso::Credential} objects
  def credentials
    @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) }
  end

  # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea}
  #   objects.
  def duty_areas
    @duty_areas ||= TaskList.new(:code => code, :edition => edition)
  end
  alias tasklist duty_areas

  # @return [Verso::ExtrasList]
  def extras
    @extras ||= if 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 ||= StandardsList.from_course(self)
  end

  # Fetch a complete task given a task id.
  #
  # @param [Fixnum] tid The task id
  # @return [Verso::Task]
  def task(tid)
    @tasks ||= {}
    @tasks[tid] ||= Task.new("code" => code, "edition" => edition,
                             "id" => tid)
  end

private

  def path
    "/courses/#{code},#{edition}"
  end
end

#durationFixnum (readonly)



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/verso/course.rb', line 40

class Course < Verso::Base
  include HTTPGettable
  attr_reader :co_op, :code, :complement, :description, :duration,
    :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt,
    :related_resources, :title
  alias co_op? co_op
  alias complement? complement
  alias hs_credit_in_ms? hs_credit_in_ms
  alias osha_exempt? osha_exempt

  # @return [String] HTML-formatted course notes
  def notes
    get_attr(:notes).to_s
  end

  # @return [Array] Collection of certification {Verso::Credential} objects
  def certifications
    @certfications ||= credentials.select { |c| c.type == "Certification" }
  end

  # @return [Array] Collection of {Verso::Credential} objects
  def credentials
    @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) }
  end

  # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea}
  #   objects.
  def duty_areas
    @duty_areas ||= TaskList.new(:code => code, :edition => edition)
  end
  alias tasklist duty_areas

  # @return [Verso::ExtrasList]
  def extras
    @extras ||= if 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 ||= StandardsList.from_course(self)
  end

  # Fetch a complete task given a task id.
  #
  # @param [Fixnum] tid The task id
  # @return [Verso::Task]
  def task(tid)
    @tasks ||= {}
    @tasks[tid] ||= Task.new("code" => code, "edition" => edition,
                             "id" => tid)
  end

private

  def path
    "/courses/#{code},#{edition}"
  end
end

#editionString (readonly)



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/verso/course.rb', line 40

class Course < Verso::Base
  include HTTPGettable
  attr_reader :co_op, :code, :complement, :description, :duration,
    :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt,
    :related_resources, :title
  alias co_op? co_op
  alias complement? complement
  alias hs_credit_in_ms? hs_credit_in_ms
  alias osha_exempt? osha_exempt

  # @return [String] HTML-formatted course notes
  def notes
    get_attr(:notes).to_s
  end

  # @return [Array] Collection of certification {Verso::Credential} objects
  def certifications
    @certfications ||= credentials.select { |c| c.type == "Certification" }
  end

  # @return [Array] Collection of {Verso::Credential} objects
  def credentials
    @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) }
  end

  # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea}
  #   objects.
  def duty_areas
    @duty_areas ||= TaskList.new(:code => code, :edition => edition)
  end
  alias tasklist duty_areas

  # @return [Verso::ExtrasList]
  def extras
    @extras ||= if 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 ||= StandardsList.from_course(self)
  end

  # Fetch a complete task given a task id.
  #
  # @param [Fixnum] tid The task id
  # @return [Verso::Task]
  def task(tid)
    @tasks ||= {}
    @tasks[tid] ||= Task.new("code" => code, "edition" => edition,
                             "id" => tid)
  end

private

  def path
    "/courses/#{code},#{edition}"
  end
end

#grade_levelsString (readonly)



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/verso/course.rb', line 40

class Course < Verso::Base
  include HTTPGettable
  attr_reader :co_op, :code, :complement, :description, :duration,
    :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt,
    :related_resources, :title
  alias co_op? co_op
  alias complement? complement
  alias hs_credit_in_ms? hs_credit_in_ms
  alias osha_exempt? osha_exempt

  # @return [String] HTML-formatted course notes
  def notes
    get_attr(:notes).to_s
  end

  # @return [Array] Collection of certification {Verso::Credential} objects
  def certifications
    @certfications ||= credentials.select { |c| c.type == "Certification" }
  end

  # @return [Array] Collection of {Verso::Credential} objects
  def credentials
    @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) }
  end

  # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea}
  #   objects.
  def duty_areas
    @duty_areas ||= TaskList.new(:code => code, :edition => edition)
  end
  alias tasklist duty_areas

  # @return [Verso::ExtrasList]
  def extras
    @extras ||= if 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 ||= StandardsList.from_course(self)
  end

  # Fetch a complete task given a task id.
  #
  # @param [Fixnum] tid The task id
  # @return [Verso::Task]
  def task(tid)
    @tasks ||= {}
    @tasks[tid] ||= Task.new("code" => code, "edition" => edition,
                             "id" => tid)
  end

private

  def path
    "/courses/#{code},#{edition}"
  end
end

#hoursnil, Fixnum (readonly)



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/verso/course.rb', line 40

class Course < Verso::Base
  include HTTPGettable
  attr_reader :co_op, :code, :complement, :description, :duration,
    :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt,
    :related_resources, :title
  alias co_op? co_op
  alias complement? complement
  alias hs_credit_in_ms? hs_credit_in_ms
  alias osha_exempt? osha_exempt

  # @return [String] HTML-formatted course notes
  def notes
    get_attr(:notes).to_s
  end

  # @return [Array] Collection of certification {Verso::Credential} objects
  def certifications
    @certfications ||= credentials.select { |c| c.type == "Certification" }
  end

  # @return [Array] Collection of {Verso::Credential} objects
  def credentials
    @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) }
  end

  # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea}
  #   objects.
  def duty_areas
    @duty_areas ||= TaskList.new(:code => code, :edition => edition)
  end
  alias tasklist duty_areas

  # @return [Verso::ExtrasList]
  def extras
    @extras ||= if 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 ||= StandardsList.from_course(self)
  end

  # Fetch a complete task given a task id.
  #
  # @param [Fixnum] tid The task id
  # @return [Verso::Task]
  def task(tid)
    @tasks ||= {}
    @tasks[tid] ||= Task.new("code" => code, "edition" => edition,
                             "id" => tid)
  end

private

  def path
    "/courses/#{code},#{edition}"
  end
end

#hs_credit_in_msBoolean (readonly) Also known as: hs_credit_in_ms?



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/verso/course.rb', line 40

class Course < Verso::Base
  include HTTPGettable
  attr_reader :co_op, :code, :complement, :description, :duration,
    :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt,
    :related_resources, :title
  alias co_op? co_op
  alias complement? complement
  alias hs_credit_in_ms? hs_credit_in_ms
  alias osha_exempt? osha_exempt

  # @return [String] HTML-formatted course notes
  def notes
    get_attr(:notes).to_s
  end

  # @return [Array] Collection of certification {Verso::Credential} objects
  def certifications
    @certfications ||= credentials.select { |c| c.type == "Certification" }
  end

  # @return [Array] Collection of {Verso::Credential} objects
  def credentials
    @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) }
  end

  # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea}
  #   objects.
  def duty_areas
    @duty_areas ||= TaskList.new(:code => code, :edition => edition)
  end
  alias tasklist duty_areas

  # @return [Verso::ExtrasList]
  def extras
    @extras ||= if 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 ||= StandardsList.from_course(self)
  end

  # Fetch a complete task given a task id.
  #
  # @param [Fixnum] tid The task id
  # @return [Verso::Task]
  def task(tid)
    @tasks ||= {}
    @tasks[tid] ||= Task.new("code" => code, "edition" => edition,
                             "id" => tid)
  end

private

  def path
    "/courses/#{code},#{edition}"
  end
end

#osha_exemptBoolean (readonly) Also known as: osha_exempt?



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/verso/course.rb', line 40

class Course < Verso::Base
  include HTTPGettable
  attr_reader :co_op, :code, :complement, :description, :duration,
    :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt,
    :related_resources, :title
  alias co_op? co_op
  alias complement? complement
  alias hs_credit_in_ms? hs_credit_in_ms
  alias osha_exempt? osha_exempt

  # @return [String] HTML-formatted course notes
  def notes
    get_attr(:notes).to_s
  end

  # @return [Array] Collection of certification {Verso::Credential} objects
  def certifications
    @certfications ||= credentials.select { |c| c.type == "Certification" }
  end

  # @return [Array] Collection of {Verso::Credential} objects
  def credentials
    @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) }
  end

  # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea}
  #   objects.
  def duty_areas
    @duty_areas ||= TaskList.new(:code => code, :edition => edition)
  end
  alias tasklist duty_areas

  # @return [Verso::ExtrasList]
  def extras
    @extras ||= if 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 ||= StandardsList.from_course(self)
  end

  # Fetch a complete task given a task id.
  #
  # @param [Fixnum] tid The task id
  # @return [Verso::Task]
  def task(tid)
    @tasks ||= {}
    @tasks[tid] ||= Task.new("code" => code, "edition" => edition,
                             "id" => tid)
  end

private

  def path
    "/courses/#{code},#{edition}"
  end
end

Returns Array of strings specifying related resources.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/verso/course.rb', line 40

class Course < Verso::Base
  include HTTPGettable
  attr_reader :co_op, :code, :complement, :description, :duration,
    :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt,
    :related_resources, :title
  alias co_op? co_op
  alias complement? complement
  alias hs_credit_in_ms? hs_credit_in_ms
  alias osha_exempt? osha_exempt

  # @return [String] HTML-formatted course notes
  def notes
    get_attr(:notes).to_s
  end

  # @return [Array] Collection of certification {Verso::Credential} objects
  def certifications
    @certfications ||= credentials.select { |c| c.type == "Certification" }
  end

  # @return [Array] Collection of {Verso::Credential} objects
  def credentials
    @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) }
  end

  # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea}
  #   objects.
  def duty_areas
    @duty_areas ||= TaskList.new(:code => code, :edition => edition)
  end
  alias tasklist duty_areas

  # @return [Verso::ExtrasList]
  def extras
    @extras ||= if 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 ||= StandardsList.from_course(self)
  end

  # Fetch a complete task given a task id.
  #
  # @param [Fixnum] tid The task id
  # @return [Verso::Task]
  def task(tid)
    @tasks ||= {}
    @tasks[tid] ||= Task.new("code" => code, "edition" => edition,
                             "id" => tid)
  end

private

  def path
    "/courses/#{code},#{edition}"
  end
end

#titleString (readonly)



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/verso/course.rb', line 40

class Course < Verso::Base
  include HTTPGettable
  attr_reader :co_op, :code, :complement, :description, :duration,
    :edition, :grade_levels, :hours, :hs_credit_in_ms, :osha_exempt,
    :related_resources, :title
  alias co_op? co_op
  alias complement? complement
  alias hs_credit_in_ms? hs_credit_in_ms
  alias osha_exempt? osha_exempt

  # @return [String] HTML-formatted course notes
  def notes
    get_attr(:notes).to_s
  end

  # @return [Array] Collection of certification {Verso::Credential} objects
  def certifications
    @certfications ||= credentials.select { |c| c.type == "Certification" }
  end

  # @return [Array] Collection of {Verso::Credential} objects
  def credentials
    @credentials ||= get_attr(:credentials).collect { |c| Credential.new(c) }
  end

  # @return [Verso::TaskList] TaskList is a collection of {Verso::DutyArea}
  #   objects.
  def duty_areas
    @duty_areas ||= TaskList.new(:code => code, :edition => edition)
  end
  alias tasklist duty_areas

  # @return [Verso::ExtrasList]
  def extras
    @extras ||= if 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 ||= StandardsList.from_course(self)
  end

  # Fetch a complete task given a task id.
  #
  # @param [Fixnum] tid The task id
  # @return [Verso::Task]
  def task(tid)
    @tasks ||= {}
    @tasks[tid] ||= Task.new("code" => code, "edition" => edition,
                             "id" => tid)
  end

private

  def path
    "/courses/#{code},#{edition}"
  end
end

Instance Method Details

#certificationsArray



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

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

#credentialsArray



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

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

#duty_areasVerso::TaskList Also known as: tasklist



67
68
69
# File 'lib/verso/course.rb', line 67

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

#extrasVerso::ExtrasList



73
74
75
76
77
78
79
# File 'lib/verso/course.rb', line 73

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

#frontmatterVerso:Frontmatter



82
83
84
85
86
87
88
# File 'lib/verso/course.rb', line 82

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

#is_hs?Boolean



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

def is_hs?
  grade_levels.split.last.to_i > 8
end

#is_ms?Boolean



91
92
93
# File 'lib/verso/course.rb', line 91

def is_ms?
  grade_levels.split.first.to_i < 9
end

#licensesArray



101
102
103
# File 'lib/verso/course.rb', line 101

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

#notesString



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

def notes
  get_attr(:notes).to_s
end

#occupation_dataArray



113
114
115
116
# File 'lib/verso/course.rb', line 113

def occupation_data
  @occupation_data ||= get_attr(:occupation_data).
    collect { |od| OccupationData.new(od) }
end

#prerequisite_coursesArray Also known as: prerequisites



106
107
108
109
# File 'lib/verso/course.rb', line 106

def prerequisite_courses
  @prerequisites ||= get_attr(:prerequisite_courses).
                       collect { |c| Course.new(c) }
end


120
121
122
123
# File 'lib/verso/course.rb', line 120

def related_courses
  @related_courses ||= get_attr(:related_courses).
                         collect { |c| Course.new(c) }
end

#standardsVerso::StandardsList



127
128
129
# File 'lib/verso/course.rb', line 127

def standards
  @standards ||= StandardsList.from_course(self)
end

#task(tid) ⇒ Verso::Task

Fetch a complete task given a task id.



135
136
137
138
139
# File 'lib/verso/course.rb', line 135

def task(tid)
  @tasks ||= {}
  @tasks[tid] ||= Task.new("code" => code, "edition" => edition,
                           "id" => tid)
end