class BloodContracts::Core::Ext::Sum
Refinement types representation of Sum
types composition, extended version
Public Class Methods
inherited(new_klass)
click to toggle source
@private
Calls superclass method
# File lib/blood_contracts/ext/sum.rb, line 10 def self.inherited(new_klass) new_klass.failure_klass ||= failure_klass 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. Also saves the Sum
errors in the context
@param (see BC::Refined#failure) @return [PolicyFailure]
Calls superclass method
# File lib/blood_contracts/ext/sum.rb, line 22 def failure(*, **) @context[:sum_errors] = @or_matches @context[:sub_scope] = self.class.name super end