class TaskJuggler::Leave
This class describes a leave.
Constants
- Types
-
This Hash defines the supported leave types. It maps the symbol to its index. The index sequence is important when multiple leaves are defined for the same time slot. A subsequent definition with a type with a larger index will override the old leave type.
Attributes
Public Class Methods
Source
# File lib/taskjuggler/LeaveList.rb, line 40 def initialize(type, interval, reason = nil) unless Types[type] raise ArgumentError, "Unsupported leave type #{type}" end @type = type @interval = interval @reason = reason end
Create a new Leave
object. interval should be an Interval
describing the leave period. type must be one of the supported leave types (:holiday, :annual, :special, :unpaid, :sick and :project ). The reason is an optional String
that describes the leave reason.
Public Instance Methods
Source
# File lib/taskjuggler/LeaveList.rb, line 53 def to_s "#{@type} #{@reason ? "\"#{@reason}\"" : ""} #{@interval}" end