Class: ReVIEW::Location

Inherits:
Object show all
Defined in:
lib/review/location.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename, compiler) ⇒ Location

Returns a new instance of Location.



3
4
5
6
# File 'lib/review/location.rb', line 3

def initialize(filename, compiler)
  @filename = filename
  @f = compiler
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



8
9
10
# File 'lib/review/location.rb', line 8

def filename
  @filename
end

Instance Method Details

#linenoObject



10
11
12
# File 'lib/review/location.rb', line 10

def lineno
  @f.current_line
end

#stringObject Also known as: to_s



14
15
16
17
18
19
20
# File 'lib/review/location.rb', line 14

def string
  begin
    "#{@filename}:#{self.lineno}"
  rescue
    "#{@filename}:nil"
  end
end