class Dry::Logic::Rule::Value
def apply(input)
def apply(input) predicate.(input) end
def args
def args @args ||= predicate.args end
def arity
def arity @arity ||= predicate.arity end
def call(input)
def call(input) if nulary? Logic.Result(predicate.(), self, input) else evaled = evaluate(input) result = apply(evaled) rule = result == true ? self : curry(evaled) Logic.Result(result, rule, input) end end
def evaluate(input)
def evaluate(input) input end
def input
def input predicate.args.last end
def nulary?
def nulary? arity == 0 end
def to_ast
def to_ast [type, predicate.to_ast] end
def type
def type :val end