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.



16
17
18
19
# File 'lib/review/compiler.rb', line 16

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

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



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

def filename
  @filename
end

Instance Method Details

#linenoObject



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

def lineno
  @f.lineno
end

#stringObject Also known as: to_s



27
28
29
30
31
32
33
# File 'lib/review/compiler.rb', line 27

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