Class: TaskJuggler::TextParser::SourceFileInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/taskjuggler/TextParser/SourceFileInfo.rb

Overview

Simple class that holds the info about a source file reference.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, line, col) ⇒ SourceFileInfo

Create a new SourceFileInfo object. file is the name of the file. line is the line in this file, col is the column number in the line.



26
27
28
29
30
# File 'lib/taskjuggler/TextParser/SourceFileInfo.rb', line 26

def initialize(file, line, col)
  @fileName = file
  @lineNo = line
  @columnNo = col
end

Instance Attribute Details

#columnNoObject (readonly)

Returns the value of attribute columnNo.



21
22
23
# File 'lib/taskjuggler/TextParser/SourceFileInfo.rb', line 21

def columnNo
  @columnNo
end

#fileNameObject (readonly)

Returns the value of attribute fileName.



21
22
23
# File 'lib/taskjuggler/TextParser/SourceFileInfo.rb', line 21

def fileName
  @fileName
end

#lineNoObject (readonly)

Returns the value of attribute lineNo.



21
22
23
# File 'lib/taskjuggler/TextParser/SourceFileInfo.rb', line 21

def lineNo
  @lineNo
end

Instance Method Details

#to_sObject

Return the info in the common “filename:line:” format.



33
34
35
36
# File 'lib/taskjuggler/TextParser/SourceFileInfo.rb', line 33

def to_s
  # The column is not reported for now.
  "#{@fileName}:#{@lineNo}:"
end