Class: Dry::Schema::PredicateRegistry Private

Inherits:
Types::PredicateRegistry
  • Object
show all
Defined in:
lib/dry/schema/predicate_registry.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A registry with predicate objects from Dry::Logic::Predicates

API:

  • private

Instance Method Summary collapse

Instance Method Details

#arg_list(name, *values) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



10
11
12
13
14
15
16
17
18
19
# File 'lib/dry/schema/predicate_registry.rb', line 10

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(arity - values.size, Undefined))
end