Class: Verso::DutyArea

Inherits:
Base
  • Object
show all
Defined in:
lib/verso/duty_area.rb

Overview

Note:

A DutyArea is created for you by TaskList. It corresponds to a portion of the Task List resource. You should never need to instantiate one yourself.

Duty Area

A group of tasks in a TaskList.

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
# File 'lib/verso/duty_area.rb', line 20

class DutyArea < Verso::Base
  attr_reader :code, :edition, :id, :title

  # Tasks within this Duty Area
  #
  # @return [Array] {Verso::Task} objects
  def tasks
    @tasks ||= get_attr(:tasks).collect do |t|
      Task.new(t.merge(:code => code, :edition => edition))
    end
  end
end

#editionString (readonly)

Returns Course edition year.

Returns:

  • (String)

    Course edition year



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/verso/duty_area.rb', line 20

class DutyArea < Verso::Base
  attr_reader :code, :edition, :id, :title

  # Tasks within this Duty Area
  #
  # @return [Array] {Verso::Task} objects
  def tasks
    @tasks ||= get_attr(:tasks).collect do |t|
      Task.new(t.merge(:code => code, :edition => edition))
    end
  end
end

#idString (readonly)

Returns DutyArea ID.

Returns:

  • (String)

    DutyArea ID



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/verso/duty_area.rb', line 20

class DutyArea < Verso::Base
  attr_reader :code, :edition, :id, :title

  # Tasks within this Duty Area
  #
  # @return [Array] {Verso::Task} objects
  def tasks
    @tasks ||= get_attr(:tasks).collect do |t|
      Task.new(t.merge(:code => code, :edition => edition))
    end
  end
end

#titleString (readonly)

Returns Duty Area title.

Returns:

  • (String)

    Duty Area title



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/verso/duty_area.rb', line 20

class DutyArea < Verso::Base
  attr_reader :code, :edition, :id, :title

  # Tasks within this Duty Area
  #
  # @return [Array] {Verso::Task} objects
  def tasks
    @tasks ||= get_attr(:tasks).collect do |t|
      Task.new(t.merge(:code => code, :edition => edition))
    end
  end
end

Instance Method Details

#tasksArray

Tasks within this Duty Area

Returns:

  • (Array)

    Task objects



26
27
28
29
30
# File 'lib/verso/duty_area.rb', line 26

def tasks
  @tasks ||= get_attr(:tasks).collect do |t|
    Task.new(t.merge(:code => code, :edition => edition))
  end
end