Class: ReVIEW::Location

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename, f) ⇒ Location

Returns a new instance of Location.



19
20
21
22
# File 'lib/review/compiler.rb', line 19

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

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



24
25
26
# File 'lib/review/compiler.rb', line 24

def filename
  @filename
end

Instance Method Details

#linenoObject



26
27
28
# File 'lib/review/compiler.rb', line 26

def lineno
  @f.lineno
end

#stringObject Also known as: to_s



30
31
32
33
34
35
36
# File 'lib/review/compiler.rb', line 30

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