class Dry::Types::Nominal
def coerce(input, &)
- Api: - private
def coerce(input, &) if primitive?(input) input elsif block_given? yield else raise CoercionError, "#{input.inspect} must be an instance of #{primitive}" end end
def coerce(input, &) if primitive?(input) input elsif block_given? yield else raise CoercionError, "#{input.inspect} must be an instance of #{primitive}" end end