class Adrian::FailureHandler::Rule

Attributes

block[R]

Public Class Methods

new(exception_class, block) click to toggle source
# File lib/adrian/failure_handler.rb, line 22
def initialize(exception_class, block)
  @exception_class = exception_class
  @block           = block
end

Public Instance Methods

match(exception) click to toggle source
# File lib/adrian/failure_handler.rb, line 27
def match(exception)
  return @exception_class.nil? if exception.nil?

  return false if @exception_class.nil?

  exception.is_a?(@exception_class)
end