Class TaskJuggler::Booking
In: lib/taskjuggler/Booking.rb
Parent: Object

Methods

new   to_s   to_tjp  

Attributes

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

Public Class methods

[Source]

# File lib/taskjuggler/Booking.rb, line 21
    def initialize(resource, task, intervals)
      @resource = resource
      @task = task
      @intervals = intervals
      @sourceFileInfo = nil
      @overtime = 0
      @sloppy = 0
    end

Public Instance methods

[Source]

# File lib/taskjuggler/Booking.rb, line 30
    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

[Source]

# File lib/taskjuggler/Booking.rb, line 43
    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

[Validate]