class Pry::LastException
Attributes
@return [String]
returns the path to a file for the current backtrace. see {#bt_index}.
@return [Fixnum]
returns the line for the current backtrace. see {#bt_index}.
Public Class Methods
Source
# File lib/pry/last_exception.rb, line 15 def initialize(exception) @exception = exception @bt_index = 0 @file, @line = bt_source_location_for(0) end
Public Instance Methods
Source
# File lib/pry/last_exception.rb, line 52 def bt_source_location_for(index) backtrace[index] =~ /(.*):(\d+)/ [::Regexp.last_match(1), ::Regexp.last_match(2).to_i] end
Source
# File lib/pry/last_exception.rb, line 57 def inc_bt_index @bt_index = (@bt_index + 1) % backtrace.size end
Source
# File lib/pry/last_exception.rb, line 21 def method_missing(name, *args, &block) if @exception.respond_to?(name) @exception.public_send(name, *args, &block) else super end end
Calls superclass method
Source
# File lib/pry/last_exception.rb, line 29 def respond_to_missing?(name, include_all = false) @exception.respond_to?(name, include_all) end
Source
# File lib/pry/last_exception.rb, line 48 def wrapped_exception @exception end
@return [Exception]
returns the wrapped exception