class Dry::Validation::PredicateRegistry

Predicate registry with additional needed methods.

Constants

WHITELIST

List of predicates to be imported by ‘:predicates_as_macros` extension.

@see Dry::Validation::Contract

Public Instance Methods

arg_names(name) click to toggle source

@api private

# File lib/dry/validation/extensions/predicates_as_macros.rb, line 18
def arg_names(name)
  arg_list(name).map(&:first)
end
call(name, args) click to toggle source

@api private

# File lib/dry/validation/extensions/predicates_as_macros.rb, line 23
def call(name, args)
  self[name].(*args)
end
message_opts(name, arg_values) click to toggle source

@api private

# File lib/dry/validation/extensions/predicates_as_macros.rb, line 28
def message_opts(name, arg_values)
  arg_names(name).zip(arg_values).to_h
end