Class TaskJuggler::Shift
In: lib/taskjuggler/Shift.rb
Parent: PropertyTreeNode

A shift is a definition of working hours for each day of the week. It may also contain a list of intervals that define off-duty periods or leaves.

Methods

Public Class methods

[Source]

# File lib/taskjuggler/Shift.rb, line 23
    def initialize(project, id, name, parent)
      super(project.shifts, id, name, parent)
      project.addShift(self)

      @data = Array.new(@project.scenarioCount, nil)
      @project.scenarioCount.times do |i|
        ShiftScenario.new(self, i, @scenarioAttributes[i])
      end
    end

Public Instance methods

Many Shift functions are scenario specific. These functions are provided by the class ShiftScenario. In case we can‘t find a function called for the Shift class we try to find it in ShiftScenario.

[Source]

# File lib/taskjuggler/Shift.rb, line 37
    def method_missing(func, scenarioIdx, *args)
      @data[scenarioIdx].method(func).call(*args)
    end

Return a reference to the scenarioIdx-th scenario.

[Source]

# File lib/taskjuggler/Shift.rb, line 42
    def scenario(scenarioIdx)
      return @data[scenarioIdx]
    end

[Validate]