Class: TaskJuggler::TagFile::TagFileEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/taskjuggler/reports/TagFile.rb

Overview

The TagFileEntry class is used to store the intermediate representation of the TagFile.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag, file, line, kind) ⇒ TagFileEntry

Create a new TagFileEntry object. tag is the property ID. file is the source file name, line the line number in this file. kind specifies the property type. The following types should be used: r : Resource t : Task p : Report



35
36
37
38
39
40
# File 'lib/taskjuggler/reports/TagFile.rb', line 35

def initialize(tag, file, line, kind)
  @tag = tag
  @file = file
  @line = line
  @kind = kind
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



27
28
29
# File 'lib/taskjuggler/reports/TagFile.rb', line 27

def file
  @file
end

#kindObject (readonly)

Returns the value of attribute kind.



27
28
29
# File 'lib/taskjuggler/reports/TagFile.rb', line 27

def kind
  @kind
end

#lineObject (readonly)

Returns the value of attribute line.



27
28
29
# File 'lib/taskjuggler/reports/TagFile.rb', line 27

def line
  @line
end

#tagObject (readonly)

Returns the value of attribute tag.



27
28
29
# File 'lib/taskjuggler/reports/TagFile.rb', line 27

def tag
  @tag
end

Instance Method Details

#<=>(e) ⇒ Object

Used to sort the tag file entries by tag.



43
44
45
# File 'lib/taskjuggler/reports/TagFile.rb', line 43

def <=>(e)
  @tag <=> e.tag
end

#to_ctagsObject

Convert the entry into a ctags compatible line.



48
49
50
# File 'lib/taskjuggler/reports/TagFile.rb', line 48

def to_ctags
  "#{@tag}\t#{@file}\t#{@line};\"\t#{@kind}\n"
end