| Class | TaskJuggler::ShiftAssignment |
| In: |
lib/taskjuggler/ShiftAssignments.rb
|
| Parent: | Object |
A ShiftAssignment associate a specific defined shift with a time interval where the shift should be active.
| interval | [RW] | |
| shiftScenario | [R] |
# File lib/taskjuggler/ShiftAssignments.rb, line 26 def initialize(shiftScenario, interval) @shiftScenario = shiftScenario @interval = interval end
Check if date is withing the assignment period.
# File lib/taskjuggler/ShiftAssignments.rb, line 52 def assigned?(date) @interval.start <= date && date < @interval.end end
# File lib/taskjuggler/ShiftAssignments.rb, line 31 def hashKey return "#{@shiftScenario.object_id}|#{@interval.start}|#{@interval.end}" end
Returns true if the shift has a leave defined for the date.
# File lib/taskjuggler/ShiftAssignments.rb, line 62 def onLeave?(date) @shiftScenario.onLeave?(date) end
Returns true if the shift has working hours defined for the date.
# File lib/taskjuggler/ShiftAssignments.rb, line 57 def onShift?(date) @shiftScenario.onShift?(date) end
Return true if the iv interval overlaps with the assignment interval.
# File lib/taskjuggler/ShiftAssignments.rb, line 41 def overlaps?(iv) @interval.overlaps?(iv) end