Class: Verso::ProgramArea

Inherits:
Base
  • Object
show all
Includes:
HTTPGettable, Sluggable
Defined in:
lib/verso/program_area.rb

Overview

Program Area

Contained by ProgramAreaList resource

Note:

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

Options Hash (attrs):

  • :title (String)

    Program Area title Required

See Also:

Instance Attribute Summary collapse

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods included from Sluggable

#slug

Methods inherited from Base

attr_reader, #initialize

Constructor Details

This class inherits a constructor from Verso::Base

Instance Attribute Details

#deprecatedBoolean (readonly)

Returns Is this Program Area deprecated?.

Returns:

  • (Boolean)

    Is this Program Area deprecated?



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/verso/program_area.rb', line 23

class ProgramArea < Verso::Base
  include HTTPGettable
  include Sluggable
  attr_reader :deprecated, :official, :section_overview, :title, :version_date

  # @return [Array] Collection of related {Verso::Course} objects
  def courses
    @courses ||= CourseList.new(:program_area => slug.gsub('-', ' ')).
                   sort_by { |c| c.title + c.edition }.
                   uniq { |c| c.code + c.edition }
  end

  # @return [String] Empty string to make consistent interface
  def description
    ""
  end

private

  def path
    "/program_areas/"
  end

  def fetch
    super[:program_areas].find { |pa| pa[:title] == title }
  end
end

#officialBoolean (readonly)

Returns Is this an official VDOE Program Area?.

Returns:

  • (Boolean)

    Is this an official VDOE Program Area?



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/verso/program_area.rb', line 23

class ProgramArea < Verso::Base
  include HTTPGettable
  include Sluggable
  attr_reader :deprecated, :official, :section_overview, :title, :version_date

  # @return [Array] Collection of related {Verso::Course} objects
  def courses
    @courses ||= CourseList.new(:program_area => slug.gsub('-', ' ')).
                   sort_by { |c| c.title + c.edition }.
                   uniq { |c| c.code + c.edition }
  end

  # @return [String] Empty string to make consistent interface
  def description
    ""
  end

private

  def path
    "/program_areas/"
  end

  def fetch
    super[:program_areas].find { |pa| pa[:title] == title }
  end
end

#section_overviewString (readonly)

Returns HTML-formatted text describing Program Area.

Returns:

  • (String)

    HTML-formatted text describing Program Area



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/verso/program_area.rb', line 23

class ProgramArea < Verso::Base
  include HTTPGettable
  include Sluggable
  attr_reader :deprecated, :official, :section_overview, :title, :version_date

  # @return [Array] Collection of related {Verso::Course} objects
  def courses
    @courses ||= CourseList.new(:program_area => slug.gsub('-', ' ')).
                   sort_by { |c| c.title + c.edition }.
                   uniq { |c| c.code + c.edition }
  end

  # @return [String] Empty string to make consistent interface
  def description
    ""
  end

private

  def path
    "/program_areas/"
  end

  def fetch
    super[:program_areas].find { |pa| pa[:title] == title }
  end
end

#titleString (readonly)

Returns Program Area title.

Returns:

  • (String)

    Program Area title



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/verso/program_area.rb', line 23

class ProgramArea < Verso::Base
  include HTTPGettable
  include Sluggable
  attr_reader :deprecated, :official, :section_overview, :title, :version_date

  # @return [Array] Collection of related {Verso::Course} objects
  def courses
    @courses ||= CourseList.new(:program_area => slug.gsub('-', ' ')).
                   sort_by { |c| c.title + c.edition }.
                   uniq { |c| c.code + c.edition }
  end

  # @return [String] Empty string to make consistent interface
  def description
    ""
  end

private

  def path
    "/program_areas/"
  end

  def fetch
    super[:program_areas].find { |pa| pa[:title] == title }
  end
end

#version_dateString (readonly)

Returns Date of last update.

Returns:

  • (String)

    Date of last update



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/verso/program_area.rb', line 23

class ProgramArea < Verso::Base
  include HTTPGettable
  include Sluggable
  attr_reader :deprecated, :official, :section_overview, :title, :version_date

  # @return [Array] Collection of related {Verso::Course} objects
  def courses
    @courses ||= CourseList.new(:program_area => slug.gsub('-', ' ')).
                   sort_by { |c| c.title + c.edition }.
                   uniq { |c| c.code + c.edition }
  end

  # @return [String] Empty string to make consistent interface
  def description
    ""
  end

private

  def path
    "/program_areas/"
  end

  def fetch
    super[:program_areas].find { |pa| pa[:title] == title }
  end
end

Instance Method Details

#coursesArray

Returns Collection of related Course objects.

Returns:

  • (Array)

    Collection of related Course objects



29
30
31
32
33
# File 'lib/verso/program_area.rb', line 29

def courses
  @courses ||= CourseList.new(:program_area => slug.gsub('-', ' ')).
                 sort_by { |c| c.title + c.edition }.
                 uniq { |c| c.code + c.edition }
end

#descriptionString

Returns Empty string to make consistent interface.

Returns:

  • (String)

    Empty string to make consistent interface



36
37
38
# File 'lib/verso/program_area.rb', line 36

def description
  ""
end