Sha256: bd857e2d161c6f1110cee6465cddc11e016a4a8425d6d4d0231c120f3a47ff0d
Contents?: true
Size: 796 Bytes
Versions: 4
Compression:
Stored size: 796 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: {}, **) @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
4 entries across 4 versions & 1 rubygems