Exception: SyntaxError

Inherits:
Exception
  • Object
show all
Defined in:
lib/sus/file.rb

Overview

Extension to SyntaxError to extract line numbers from error messages.

Instance Method Summary collapse

Instance Method Details

#linenoObject

Extract the line number from the error message.



18
19
20
21
22
# File 'lib/sus/file.rb', line 18

def lineno
	if message =~ /:(\d+):/
		$1.to_i
	end
end