Class: Verso::CorrelationList

Inherits:
Base
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable, HTTPGettable
Defined in:
lib/verso/correlation_list.rb

Overview

Correlation List Resource

A crosswalk of competencies to standards body goals.

Note:

Certain attributes are required for instantiation.

Options Hash (attrs):

  • :code (String)

    Course code Required

  • :edition (String)

    Edition year Required

  • :name (String)

    Standards Body name 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

#codeString (readonly)

Returns Course code.

Returns:

  • (String)

    Course code



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/verso/correlation_list.rb', line 20

class CorrelationList < Verso::Base
  include Enumerable
  include HTTPGettable
  extend Forwardable
  def_delegators :correlations, :[], :each, :empty?, :last, :length
  attr_reader :code, :edition, :name

  # @return [String] Standards body title
  def title
    @title ||= first.goals.first.title
  end

private

  def correlations
    @correlations ||= get_attr(:correlations).
      collect { |c| Task.new(c.merge(:code => code, :edition => edition)) }
  end

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

#editionString (readonly)

Returns Edition year.

Returns:

  • (String)

    Edition year



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/verso/correlation_list.rb', line 20

class CorrelationList < Verso::Base
  include Enumerable
  include HTTPGettable
  extend Forwardable
  def_delegators :correlations, :[], :each, :empty?, :last, :length
  attr_reader :code, :edition, :name

  # @return [String] Standards body title
  def title
    @title ||= first.goals.first.title
  end

private

  def correlations
    @correlations ||= get_attr(:correlations).
      collect { |c| Task.new(c.merge(:code => code, :edition => edition)) }
  end

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

#nameString (readonly)

Returns Standards Body name, used as an identifier and not to be confused with its title.

Returns:

  • (String)

    Standards Body name, used as an identifier and not to be confused with its title



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/verso/correlation_list.rb', line 20

class CorrelationList < Verso::Base
  include Enumerable
  include HTTPGettable
  extend Forwardable
  def_delegators :correlations, :[], :each, :empty?, :last, :length
  attr_reader :code, :edition, :name

  # @return [String] Standards body title
  def title
    @title ||= first.goals.first.title
  end

private

  def correlations
    @correlations ||= get_attr(:correlations).
      collect { |c| Task.new(c.merge(:code => code, :edition => edition)) }
  end

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

Instance Method Details

#titleString

Returns Standards body title.

Returns:

  • (String)

    Standards body title



28
29
30
# File 'lib/verso/correlation_list.rb', line 28

def title
  @title ||= first.goals.first.title
end