Class: Verso::Extra

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

Overview

Extra resource

An extra (or related material) associated with a Course framework in Verso.

Note:

Certain attributes are required for instantiation.

Options Hash (attrs):

  • :code (String)

    Course code Required

  • :edition (String)

    Edition year Required

  • :name (String)

    Extra name Required

See Also:

Instance Attribute Summary collapse

Attributes inherited from Base

#attrs

Method Summary

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



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/verso/extra.rb', line 26

class Extra < Verso::Base
  include HTTPGettable
  attr_reader :code, :description, :edition, :name, :title

private

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

  def fetch
    super[:extra]
  end
end

#descriptionString (readonly)

Returns HTML-formatted Extra description.

Returns:

  • (String)

    HTML-formatted Extra description



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/verso/extra.rb', line 26

class Extra < Verso::Base
  include HTTPGettable
  attr_reader :code, :description, :edition, :name, :title

private

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

  def fetch
    super[:extra]
  end
end

#editionString (readonly)

Returns Edition year.

Returns:

  • (String)

    Edition year



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/verso/extra.rb', line 26

class Extra < Verso::Base
  include HTTPGettable
  attr_reader :code, :description, :edition, :name, :title

private

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

  def fetch
    super[:extra]
  end
end

#nameString (readonly)

Returns Extra name, used as an identifier and not to be confused with its title, found by Verso::ExtrasList.

Returns:

  • (String)

    Extra name, used as an identifier and not to be confused with its title, found by Verso::ExtrasList



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/verso/extra.rb', line 26

class Extra < Verso::Base
  include HTTPGettable
  attr_reader :code, :description, :edition, :name, :title

private

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

  def fetch
    super[:extra]
  end
end

#titleString (readonly)

Returns Extra title.

Returns:

  • (String)

    Extra title



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/verso/extra.rb', line 26

class Extra < Verso::Base
  include HTTPGettable
  attr_reader :code, :description, :edition, :name, :title

private

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

  def fetch
    super[:extra]
  end
end