Class: Yeller::SkipExceptions

Inherits:
Object
  • Object
show all
Defined in:
lib/yeller/skip_exceptions.rb

Instance Method Summary collapse

Constructor Details

#initialize(error_names, callback) ⇒ SkipExceptions

Returns a new instance of SkipExceptions.



4
5
6
7
# File 'lib/yeller/skip_exceptions.rb', line 4

def initialize(error_names, callback)
  @error_names = Set.new(error_names)
  @callback = callback
end

Instance Method Details

#skip?(exception) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
# File 'lib/yeller/skip_exceptions.rb', line 9

def skip?(exception)
  @error_names.include?(exception.class.name) ||
    @callback.call(exception)
end