Class: TaskJuggler::ReferenceAttribute

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_sort

Constructor Details

#initialize(property, type, container) ⇒ ReferenceAttribute

Returns a new instance of ReferenceAttribute.



449
450
451
# File 'lib/taskjuggler/Attributes.rb', line 449

def initialize(property, type, container)
  super
end

Class Method Details

.tjpIdObject



453
454
455
# File 'lib/taskjuggler/Attributes.rb', line 453

def ReferenceAttribute::tjpId
  'reference'
end

Instance Method Details

#labelObject



476
477
478
# File 'lib/taskjuggler/Attributes.rb', line 476

def label
  (v = get) ? (v[1] ? v[1][0] : v[0]) : nil
end

#to_rti(query) ⇒ Object



461
462
463
464
465
466
# File 'lib/taskjuggler/Attributes.rb', line 461

def to_rti(query)
  return nil unless get

  rText = RichText.new("[#{url} #{label}]")
  rText.generateIntermediateFormat
end

#to_s(query = nil) ⇒ Object



457
458
459
# File 'lib/taskjuggler/Attributes.rb', line 457

def to_s(query = nil)
  url || ''
end

#to_tjpObject



468
469
470
# File 'lib/taskjuggler/Attributes.rb', line 468

def to_tjp
  "#{@type.id} \"#{url}\"#{label ? " { label \"#{label}\" }" : ''}"
end

#urlObject



472
473
474
# File 'lib/taskjuggler/Attributes.rb', line 472

def url
  (v = get) ? v[0] : nil
end