class BloodContracts::Core::Ext::Refined
Refinement type exteneded with Extractable
, ExceptionHandling
and errors representation in form of Tram::Policy::Errors
Public Class Methods
and_then(other_type)
click to toggle source
Compose types in a Pipe
check Pipe
passes data from type to type sequentially
@return [BC::Pipe]
# File lib/blood_contracts/ext/refined.rb, line 43 def and_then(other_type) BC::Ext::Pipe.new(self, other_type) end
Also aliased as: >
inherited(new_klass)
click to toggle source
@private
Calls superclass method
# File lib/blood_contracts/ext/refined.rb, line 52 def inherited(new_klass) new_klass.failure_klass ||= failure_klass new_klass.prepend ExceptionHandling super end
Public Instance Methods
failure(*, **)
click to toggle source
Generate an PolicyFailure
from the error, also stores the additional scope for Tram::Policy::Errors in the context
@param (see BC::Refined#failure) @return [PolicyFailure]
Calls superclass method
# File lib/blood_contracts/ext/refined.rb, line 65 def failure(*, **) @context[:sub_scope] = self.class.name super end