Class: BloodContracts::Instrumentation::FailedMatch
- Inherits:
-
BC::ContractFailure
- Object
- BC::ContractFailure
- BloodContracts::Instrumentation::FailedMatch
- Defined in:
- lib/blood_contracts/instrumentation/failed_match.rb
Overview
Wrapper for exception happend during the match instrumentation Should not be used in the app, to distinguish between expected and unexpected failures
Instance Method Summary collapse
-
#exception ⇒ Exception
Reader for the exception caught.
-
#initialize(exception, context: {}) ⇒ FailedMatch
constructor
Initialize failure type with exception.
-
#valid? ⇒ Boolean
Predicate, whether the data is valid or not (for the ExceptionCaught it is always False).
Constructor Details
#initialize(exception, context: {}) ⇒ FailedMatch
Initialize failure type with exception
16 17 18 19 20 21 |
# File 'lib/blood_contracts/instrumentation/failed_match.rb', line 16 def initialize(exception, context: {}) @errors = [] @context = context @value = exception @context[:exception] = exception end |
Instance Method Details
#exception ⇒ Exception
Reader for the exception caught
36 37 38 |
# File 'lib/blood_contracts/instrumentation/failed_match.rb', line 36 def exception @context[:exception] end |
#valid? ⇒ Boolean
Predicate, whether the data is valid or not (for the ExceptionCaught it is always False)
28 29 30 |
# File 'lib/blood_contracts/instrumentation/failed_match.rb', line 28 def valid? false end |