class TaskJuggler::ShiftScenario

This class handles the scenario specific features of a Shift object.

Public Class Methods

new(resource, scenarioIdx, attributes) click to toggle source
Calls superclass method TaskJuggler::ScenarioData::new
# File lib/taskjuggler/ShiftScenario.rb, line 21
def initialize(resource, scenarioIdx, attributes)
  super
end

Public Instance Methods

onLeave?(date) click to toggle source

Returns true if the shift has a vacation defined for the date.

# File lib/taskjuggler/ShiftScenario.rb, line 35
def onLeave?(date)
  a('leaves').each do |leave|
    if leave.interval.contains?(date)
      return true
    end
  end
  false
end
onShift?(date) click to toggle source

Returns true if the shift has working time defined for the date.

# File lib/taskjuggler/ShiftScenario.rb, line 26
def onShift?(date)
  a('workinghours').onShift?(date)
end
replace?() click to toggle source
# File lib/taskjuggler/ShiftScenario.rb, line 30
def replace?
  a('replace')
end