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.
# File lib/taskjuggler/Shift.rb, line 22 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
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.
# File lib/taskjuggler/Shift.rb, line 36 def method_missing(func, scenarioIdx, *args) @data[scenarioIdx].method(func).call(*args) end
Return a reference to the scenarioIdx-th scenario.
# File lib/taskjuggler/Shift.rb, line 41 def scenario(scenarioIdx) return @data[scenarioIdx] end