View Source Dx.Engine (dx v0.3.0)
Encapsulates the main functionality of working with rules.
Link to this section Summary
Functions
Traverses the value of a rule, replacing special tuples
Returns the result of evaluating a field or predicate.
Returns the result of evaluating a predicate.
Link to this section Functions
@spec evaluate_condition(any(), any(), Dx.Evaluation.t()) :: Dx.Result.b()
Traverses the value of a rule, replacing special tuples
{:ref, path}
with the predicate or field value found at the given path{fun/n, arg_1, ..., arg_n}
with the result of calling the given function with the given arguments (which in turn can be special tuples){:bound, :var}
- with a corresponding matching{:bind, :var}
{:bound, :var, default}
- same with default- ...
@spec resolve(atom(), map(), Dx.Evaluation.t()) :: Dx.Result.v()
Returns the result of evaluating a field or predicate.
@spec resolve_predicate(atom(), struct(), Dx.Evaluation.t()) :: Dx.Result.v()
Returns the result of evaluating a predicate.