class TaskJuggler::Booking

Attributes

intervals[R]
overtime[RW]
resource[R]
sloppy[RW]
sourceFileInfo[RW]
task[R]

Public Class Methods

new(resource, task, intervals) click to toggle source
# File lib/taskjuggler/Booking.rb, line 20
def initialize(resource, task, intervals)
  @resource = resource
  @task = task
  @intervals = intervals
  @sourceFileInfo = nil
  @overtime = 0
  @sloppy = 0
end

Public Instance Methods

to_s() click to toggle source
# File lib/taskjuggler/Booking.rb, line 29
def to_s
  out = "#{@resource.fullId} "
  first = true
  @intervals.each do |iv|
    if first
      first = false
    else
      out += ", "
    end
    out += "#{iv.start} + #{(iv.end - iv.start) / 3600}h"
  end
end
to_tjp(taskMode) click to toggle source
# File lib/taskjuggler/Booking.rb, line 42
def to_tjp(taskMode)
  out = taskMode ? "#{@task.fullId} " : "#{@resource.fullId} "
  first = true
  @intervals.each do |iv|
    if first
      first = false
    else
      out += ",\n"
    end
    out += "#{iv.start} + #{(iv.end - iv.start) / 3600}h"
  end
  out += ' { overtime 2 }'
end