Exception: Exception

Defined in:
library/blur/enhancements.rb

Overview

Reopens the scope of the standard Exception-class to extend it with helpful methods.

Constant Summary

Pattern =

The pattern to match against the backtrace log.

/^.*?:(\d+):/

Instance Method Summary (collapse)

Instance Method Details

- (Object) line

Retrieve the line on which the exception was raised from when raised inside a script.

Returns:

  • Fixnum the line of the script the exception was raised on.



13
14
15
# File 'library/blur/enhancements.rb', line 13

def line
  backtrace[0].match(Pattern)[1].to_i + 1
end