Class: TaskJuggler::DurationAttribute

Inherits:
AttributeBase show all
Defined in:
lib/taskjuggler/Attributes.rb

Instance Attribute Summary

Attributes inherited from AttributeBase

#inherited, #property, #provided, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AttributeBase

#get, #id, #inherit, isList?, #isList?, mode, #name, #nil?, #reset, #set, setMode, #to_num, #to_rti, #to_sort

Constructor Details

#initialize(property, type, container) ⇒ DurationAttribute

Returns a new instance of DurationAttribute.



248
249
250
# File 'lib/taskjuggler/Attributes.rb', line 248

def initialize(property, type, container)
  super
end

Class Method Details

.tjpIdObject



252
253
254
# File 'lib/taskjuggler/Attributes.rb', line 252

def DurationAttribute::tjpId
  'duration'
end

Instance Method Details

#to_s(query = nil) ⇒ Object



260
261
262
263
# File 'lib/taskjuggler/Attributes.rb', line 260

def to_s(query = nil)
  query ? query.scaleDuration(query.project.slotsToDays(get)) :
          get.to_s
end

#to_tjpObject



256
257
258
# File 'lib/taskjuggler/Attributes.rb', line 256

def to_tjp
  @type.id + ' ' + get.to_s + 'h'
end