Module: Docile::BacktraceFilter Private

Defined in:
lib/docile/backtrace_filter.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

This is used to remove entries pointing to Docile's source files from Exception#backtrace and Exception#backtrace_locations.

If NoMethodError is caught then the exception object will be extended by this module to add filter functionalities.

Constant Summary collapse

FILTER_PATTERN =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

%r{/lib/docile/}.freeze

Instance Method Summary collapse

Instance Method Details

#backtraceObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



14
15
16
# File 'lib/docile/backtrace_filter.rb', line 14

def backtrace
  super.reject { |trace| trace =~ FILTER_PATTERN }
end

#backtrace_locationsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



19
20
21
# File 'lib/docile/backtrace_filter.rb', line 19

def backtrace_locations
  super.reject { |location| location.absolute_path =~ FILTER_PATTERN }
end