Class: ReVIEW::Location
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
-
#initialize(filename, compiler) ⇒ Location
constructor
A new instance of Location.
- #lineno ⇒ Object
- #string ⇒ Object (also: #to_s)
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
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
8 9 10 |
# File 'lib/review/location.rb', line 8 def filename @filename end |
Instance Method Details
#lineno ⇒ Object
10 11 12 |
# File 'lib/review/location.rb', line 10 def lineno @f.current_line end |
#string ⇒ Object 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 |