Class: Adrian::FailureHandler::Rule
- Inherits:
-
Object
- Object
- Adrian::FailureHandler::Rule
- Defined in:
- lib/adrian/failure_handler.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Instance Method Summary collapse
-
#initialize(exception_class, block) ⇒ Rule
constructor
A new instance of Rule.
- #match(exception) ⇒ Object
Constructor Details
#initialize(exception_class, block) ⇒ Rule
Returns a new instance of Rule.
22 23 24 25 |
# File 'lib/adrian/failure_handler.rb', line 22 def initialize(exception_class, block) @exception_class = exception_class @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
20 21 22 |
# File 'lib/adrian/failure_handler.rb', line 20 def block @block end |
Instance Method Details
#match(exception) ⇒ Object
27 28 29 30 31 32 33 |
# 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 |