Class: TaskJuggler::ResourceListAttribute

Inherits:
ListAttributeBase 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 ListAttributeBase

#isList?, isList?

Methods inherited from AttributeBase

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

Constructor Details

#initialize(property, type, container) ⇒ ResourceListAttribute

Returns a new instance of ResourceListAttribute.



484
485
486
# File 'lib/taskjuggler/Attributes.rb', line 484

def initialize(property, type, container)
  super
end

Class Method Details

.tjpIdObject



488
489
490
# File 'lib/taskjuggler/Attributes.rb', line 488

def ResourceListAttribute::tjpId
  'resourcelist'
end

Instance Method Details

#to_rti(query = nil) ⇒ Object



498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
# File 'lib/taskjuggler/Attributes.rb', line 498

def to_rti(query = nil)
  out = []
  if query
    get.each do |r|
      if query.listItem
        rti = RichText.new(query.listItem, RTFHandlers.create(r.project)).
          generateIntermediateFormat
        q = query.dup
        q.property = r
        rti.setQuery(q)
        out << "<nowiki>#{rti.to_s}</nowiki>"
      else
        out << "<nowiki>#{r.name}</nowiki>"
      end
    end
    query.assignList(out)
  else
    get.each { |r| out << r.name }
    rText = RichText.new(out.join(', '))
    rText.generateIntermediateFormat
  end
end

#to_s(query = nil) ⇒ Object



492
493
494
495
496
# File 'lib/taskjuggler/Attributes.rb', line 492

def to_s(query = nil)
  out = []
  get.each { |r| out << r.fullId }
  out.join(", ")
end

#to_tjpObject



521
522
523
524
525
# File 'lib/taskjuggler/Attributes.rb', line 521

def to_tjp
  out = []
  get.each { |r| out << r.fullId }
  @type.id + " " + out.join(', ')
end