lib/dry/schema/trace.rb in dry-schema-0.1.1 vs lib/dry/schema/trace.rb in dry-schema-0.2.0
- old
+ new
@@ -26,20 +26,23 @@
@captures = []
end
# @api private
def evaluate(*predicates, **opts, &block)
+ pred_opts = opts.dup
+ pred_opts.delete(:type_spec)
+
predicates.each do |predicate|
if predicate.respond_to?(:call)
append(predicate)
elsif predicate.is_a?(::Array)
append(predicate.map { |pred| __send__(pred) }.reduce(:|))
else
append(__send__(predicate))
end
end
- opts.each do |predicate, *args|
+ pred_opts.each do |predicate, *args|
append(__send__(predicate, *args))
end
self
end