lib/dry/schema/macros/filled.rb in dry-schema-1.10.2 vs lib/dry/schema/macros/filled.rb in dry-schema-1.10.3

- old
+ new

@@ -11,15 +11,18 @@ class Filled < Value # @api private def call(*predicates, **opts, &block) ensure_valid_predicates(predicates) - if opts[:type_spec] && !filter_empty_string? - value(predicates[0], :filled?, *predicates[1..predicates.size - 1], **opts, &block) - elsif opts[:type_rule] - value(:filled?).value(*predicates, **opts, &block) - else - value(:filled?, *predicates, **opts, &block) + append_macro(Macros::Value) do |macro| + if opts[:type_spec] && !filter_empty_string? + macro.call(predicates[0], :filled?, *predicates[1..predicates.size - 1], **opts, + &block) + elsif opts[:type_rule] + macro.call(:filled?).value(*predicates, **opts, &block) + else + macro.call(:filled?, *predicates, **opts, &block) + end end end # @api private def ensure_valid_predicates(predicates)