class Dry::Logic::Builder::Context
def predicate(name, context = nil, &block)
@name [Symbol] Name of predicate
Defines custom predicate
def predicate(name, context = nil, &block) if singleton_class.method_defined?(name) singleton_class.undef_method(name) end predicate = Rule::Predicate.new(context || block) define_singleton_method(name) do |*args| predicate.curry(*args) end end