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, f) ⇒ Location

Returns a new instance of Location.



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

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

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



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

def filename
  @filename
end

Instance Method Details

#linenoObject



18
19
20
# File 'lib/review/location.rb', line 18

def lineno
  @f.lineno
end

#stringObject Also known as: to_s



22
23
24
25
26
27
28
# File 'lib/review/location.rb', line 22

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