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



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

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.



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

def file
  @file
end

#kindObject (readonly)

Returns the value of attribute kind.



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

def kind
  @kind
end

#lineObject (readonly)

Returns the value of attribute line.



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

def line
  @line
end

#tagObject (readonly)

Returns the value of attribute tag.



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

def tag
  @tag
end

Instance Method Details

#<=>(e) ⇒ Object

Used to sort the tag file entries by tag.



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

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

#to_ctagsObject

Convert the entry into a ctags compatible line.



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

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