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.



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

def initialize(property, type, container)
  super
end

Class Method Details

.tjpIdObject



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

def ResourceListAttribute::tjpId
  'resourcelist'
end

Instance Method Details

#to_rti(query = nil) ⇒ Object



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

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



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

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

#to_tjpObject



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

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