Sha256: f177ee136c11290bb2b50ae6c44aa2487abacc746ac8839412153bd3702dec8b
Contents?: true
Size: 823 Bytes
Versions: 1
Compression:
Stored size: 823 Bytes
Contents
module BloodContracts::Core # Refinement type which holds exception as a value class ExceptionCaught < ContractFailure # Constructs refinement type around exception # # @param value [Exception] value which is wrapped inside the type # @option context [Hash] shared context of types matching pipeline # def initialize(value = nil, context: Hash.new { |h, k| h[k] = {} }, **) @errors = [] @context = context @value = value @context[:exception] = value end # Predicate, whether the data is valid or not # (for the ExceptionCaught it is always False) # # @return [Boolean] # def valid? false end # Reader for the exception caught # # @return [Exception] # def exception @context[:exception] end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
blood_contracts-ext-0.1.0 | lib/blood_contracts/core/exception_caught.rb |