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.
21 22 23 24 25 26 27 28 |
# 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 |
Instance Attribute Details
#intervals ⇒ Object (readonly)
Returns the value of attribute intervals.
18 19 20 |
# File 'lib/taskjuggler/Booking.rb', line 18 def intervals @intervals end |
#overtime ⇒ Object
Returns the value of attribute overtime.
19 20 21 |
# File 'lib/taskjuggler/Booking.rb', line 19 def overtime @overtime end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
18 19 20 |
# File 'lib/taskjuggler/Booking.rb', line 18 def resource @resource end |
#sloppy ⇒ Object
Returns the value of attribute sloppy.
19 20 21 |
# File 'lib/taskjuggler/Booking.rb', line 19 def sloppy @sloppy end |
#sourceFileInfo ⇒ Object
Returns the value of attribute sourceFileInfo.
19 20 21 |
# File 'lib/taskjuggler/Booking.rb', line 19 def sourceFileInfo @sourceFileInfo end |
#task ⇒ Object (readonly)
Returns the value of attribute task.
18 19 20 |
# File 'lib/taskjuggler/Booking.rb', line 18 def task @task end |
Instance Method Details
#to_s ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 |
# 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 |
#to_tjp(taskMode) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# 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 |