Class: TaskJuggler::ShiftAssignmentsAttribute

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_s, #to_sort

Constructor Details

#initialize(property, type, container) ⇒ ShiftAssignmentsAttribute

Returns a new instance of ShiftAssignmentsAttribute.



569
570
571
572
573
# File 'lib/taskjuggler/Attributes.rb', line 569

def initialize(property, type, container)
  super
  v = get
  v.project = property.project if v
end

Class Method Details

.tjpIdObject



575
576
577
# File 'lib/taskjuggler/Attributes.rb', line 575

def ShiftAssignmentsAttribute::tjpId
  'shifts'
end

Instance Method Details

#to_tjpObject



579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
# File 'lib/taskjuggler/Attributes.rb', line 579

def to_tjp
  v = get
  first = true
  str = 'shifts '
  v.assignments.each do |sa|
    if first
      first = false
    else
      str += ",\n"
    end

    str += "#{sa.shiftScenario.property.fullId} #{sa.interval}"
  end

  str
end