The LeaveAllowanceList can store lists of LeaveAllowance objects. Allowances are counted in time slots and can be negative to substract expired allowances.
Create a new empty LeaveAllowanceList.
# File lib/taskjuggler/LeaveList.rb, line 82 def initialize(*args) super(*args) end
# File lib/taskjuggler/LeaveList.rb, line 86 def balance(type, startDate, endDate) unless Leave::Types[type] raise ArgumentError, "Unsupported leave type #{type}" end balance = 0.0 each do |al| balance += al.slots if al.type == type && al.date >= startDate && al.date < endDate end balance end