Class: TaskJuggler::Booking
Instance Attribute Summary collapse
-
#intervals ⇒ Object
readonly
Returns the value of attribute intervals.
-
#overtime ⇒ Object
Returns the value of attribute overtime.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#sloppy ⇒ Object
Returns the value of attribute sloppy.
-
#sourceFileInfo ⇒ Object
Returns the value of attribute sourceFileInfo.
-
#task ⇒ Object
readonly
Returns the value of attribute task.
Instance Method Summary collapse
-
#initialize(resource, task, intervals) ⇒ Booking
constructor
A new instance of Booking.
- #to_s ⇒ Object
- #to_tjp(taskMode) ⇒ Object
Constructor Details
#initialize(resource, task, intervals) ⇒ Booking
Returns a new instance of Booking.
22 23 24 25 26 27 28 29 |
# File 'lib/taskjuggler/Booking.rb', line 22 def initialize(resource, task, intervals) @resource = resource @task = task @intervals = intervals @sourceFileInfo = nil @overtime = 0 @sloppy = 0 end |
Instance Attribute Details
#intervals ⇒ Object (readonly)
Returns the value of attribute intervals.
19 20 21 |
# File 'lib/taskjuggler/Booking.rb', line 19 def intervals @intervals end |
#overtime ⇒ Object
Returns the value of attribute overtime.
20 21 22 |
# File 'lib/taskjuggler/Booking.rb', line 20 def overtime @overtime end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
19 20 21 |
# File 'lib/taskjuggler/Booking.rb', line 19 def resource @resource end |
#sloppy ⇒ Object
Returns the value of attribute sloppy.
20 21 22 |
# File 'lib/taskjuggler/Booking.rb', line 20 def sloppy @sloppy end |
#sourceFileInfo ⇒ Object
Returns the value of attribute sourceFileInfo.
20 21 22 |
# File 'lib/taskjuggler/Booking.rb', line 20 def sourceFileInfo @sourceFileInfo end |
#task ⇒ Object (readonly)
Returns the value of attribute task.
19 20 21 |
# File 'lib/taskjuggler/Booking.rb', line 19 def task @task end |
Instance Method Details
#to_s ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/taskjuggler/Booking.rb', line 31 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) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/taskjuggler/Booking.rb', line 44 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 |