lib/dry/schema/trace.rb in dry-schema-1.4.3 vs lib/dry/schema/trace.rb in dry-schema-1.5.0

- old
+ new

@@ -1,10 +1,10 @@ # frozen_string_literal: true -require 'dry/schema/constants' -require 'dry/schema/compiler' -require 'dry/schema/predicate' +require "dry/schema/constants" +require "dry/schema/compiler" +require "dry/schema/predicate" module Dry module Schema # Captures predicates defined within the DSL # @@ -27,11 +27,12 @@ @compiler = compiler @captures = [] end # @api private - def evaluate(*args, type_spec: ::Dry::Schema::Undefined, **opts) + def evaluate(*args, **opts) predicates = opts.empty? ? args : args.push(opts) + evaluate_predicates(predicates).each do |rule| append(rule) end self