lib/dry/schema/predicate_registry.rb in dry-schema-1.12.0 vs lib/dry/schema/predicate_registry.rb in dry-schema-1.13.0
- old
+ new
@@ -7,14 +7,16 @@
# @api private
class PredicateRegistry < Dry::Types::PredicateRegistry
# @api private
def arg_list(name, *values)
predicate = self[name]
+ # Cater for optional second argument like in case of `eql?` or `respond_to?`
+ arity = predicate.arity.abs
predicate
.parameters
.map(&:last)
- .zip(values + Array.new(predicate.arity - values.size, Undefined))
+ .zip(values + Array.new(arity - values.size, Undefined))
end
end
end
end