View Source Ash.Query.Function behaviour (ash v2.19.3)
A function is a predicate with an arguments list.
For more information on being a predicate, see Ash.Filter.Predicate
. Most of the complexities
are there. A function must meet both behaviours.
Summary
Callbacks
The number and types of arguments supported.
If true
, will be allowed to evaluate nil
inputs.
Functions
Evaluate the operator with provided inputs
Attaches the appropriate suffix to refer to an ordinal number, e.g 1 -> "1st"
Types
@type arg() :: any()
Callbacks
@callback args() :: [arg()] | :var_args
The number and types of arguments supported.
@callback eager_evaluate?() :: boolean()
@callback evaluate_nil_inputs?() :: boolean()
If true
, will be allowed to evaluate nil
inputs.
If false
(the default), any nil
inputs will cause a nil
return.
@callback name() :: atom()
@callback new([term()]) :: {:ok, term()} | {:error, String.t() | Exception.t()}
@callback partial_evaluate(func) :: func when func: map()
@callback predicate?() :: boolean()
@callback private?() :: boolean()
Functions
Evaluate the operator with provided inputs
Attaches the appropriate suffix to refer to an ordinal number, e.g 1 -> "1st"