Sha256: 0e1db1751d159f24b22636887dd6545d1b365b3fe21559555662de6baf5aa973

Contents?: true

Size: 539 Bytes

Versions: 22

Compression:

Stored size: 539 Bytes

Contents

# frozen_string_literal: true

require "dry/logic/predicates"
require "dry/types/predicate_registry"

module Dry
  module Schema
    # A registry with predicate objects from `Dry::Logic::Predicates`
    #
    # @api private
    class PredicateRegistry < Dry::Types::PredicateRegistry
      # @api private
      def arg_list(name, *values)
        predicate = self[name]

        predicate
          .parameters
          .map(&:last)
          .zip(values + Array.new(predicate.arity - values.size, Undefined))
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
dry-schema-1.10.6 lib/dry/schema/predicate_registry.rb
dry-schema-1.10.5 lib/dry/schema/predicate_registry.rb
dry-schema-1.10.4 lib/dry/schema/predicate_registry.rb
dry-schema-1.10.2 lib/dry/schema/predicate_registry.rb
dry-schema-1.10.1 lib/dry/schema/predicate_registry.rb
dry-schema-1.9.3 lib/dry/schema/predicate_registry.rb
dry-schema-1.9.2 lib/dry/schema/predicate_registry.rb
dry-schema-1.9.1 lib/dry/schema/predicate_registry.rb
dry-schema-1.9.0 lib/dry/schema/predicate_registry.rb
dry-schema-1.8.0 lib/dry/schema/predicate_registry.rb
dry-schema-1.7.1 lib/dry/schema/predicate_registry.rb
dry-schema-1.7.0 lib/dry/schema/predicate_registry.rb
dry-schema-1.6.2 lib/dry/schema/predicate_registry.rb
dry-schema-1.6.1 lib/dry/schema/predicate_registry.rb
dry-schema-1.6.0 lib/dry/schema/predicate_registry.rb
dry-schema-1.5.6 lib/dry/schema/predicate_registry.rb
dry-schema-1.5.5 lib/dry/schema/predicate_registry.rb
dry-schema-1.5.4 lib/dry/schema/predicate_registry.rb
dry-schema-1.5.3 lib/dry/schema/predicate_registry.rb
dry-schema-1.5.2 lib/dry/schema/predicate_registry.rb