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



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

class DutyArea < Verso::Base
  attr_reader :code, :edition, :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



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

class DutyArea < Verso::Base
  attr_reader :code, :edition, :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



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

class DutyArea < Verso::Base
  attr_reader :code, :edition, :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



24
25
26
27
28
# File 'lib/verso/duty_area.rb', line 24

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