Class: Yeller::SkipExceptions
- Inherits:
-
Object
- Object
- Yeller::SkipExceptions
- Defined in:
- lib/yeller/skip_exceptions.rb
Instance Method Summary collapse
-
#initialize(error_names, callback) ⇒ SkipExceptions
constructor
A new instance of SkipExceptions.
- #skip?(exception) ⇒ Boolean
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
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 |