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.



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

def initialize(property, type, container)
  super
end

Class Method Details

.tjpIdObject



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

def ReferenceAttribute::tjpId
  'reference'
end

Instance Method Details

#labelObject



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

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

#to_rti(query) ⇒ Object



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

def to_rti(query)
  return nil unless get

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

#to_s(query = nil) ⇒ Object



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

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

#to_tjpObject



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

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

#urlObject



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

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