Class TaskJuggler::AllocationAttribute
In: lib/taskjuggler/Attributes.rb
Parent: AttributeBase

Methods

new   tjpId   to_s   to_tjp  

Public Class methods

[Source]

# File lib/taskjuggler/Attributes.rb, line 58
    def initialize(property, type, container)
      super

      set(Array.new)
    end

[Source]

# File lib/taskjuggler/Attributes.rb, line 64
    def AllocationAttribute::tjpId
      'allocation'
    end

Public Instance methods

[Source]

# File lib/taskjuggler/Attributes.rb, line 77
    def to_s(query = nil)
      out = ''
      first = true
      get.each do |allocation|
        if first
          first = false
        else
          out << "\n"
        end
        out << '[ '
        firstR = true
        allocation.candidates.each do |resource|
          if firstR
            firstR = false
          else
            out << ', '
          end
          out << resource.fullId
        end
        modes = %w(order lowprob lowload hiload random)
        out << " ] select by #{modes[allocation.selectionMode]} "
        out << 'mandatory ' if allocation.mandatory
        out << 'persistent ' if allocation.persistent
      end
      out
    end

[Source]

# File lib/taskjuggler/Attributes.rb, line 68
    def to_tjp
      out = []
      get.each do |allocation|
        out.push("allocate #{allocation.to_tjp}\n")
        # TODO: incomplete
      end
      out
    end

[Validate]