#
View Source Ash.Query.Function behaviour (ash v2.6.31)

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.

# Link to this section Summary

## Types

arg()

## Callbacks

args()

The number and types of arguments supported.

evaluate(func)
new(list)
private?()

## Functions

new(mod, args)
ordinal(num)

Attaches the appropriate suffix to refer to an ordinal number, e.g 1 -> "1st"

try_cast_arguments(configured_args, args)

# Link to this section Types

Link to this type

# arg()

View Source

    @type arg() :: any()

# Link to this section Callbacks

Link to this callback

# args()

View Source

    @callback args() :: [arg()]

The number and types of arguments supported.

Link to this callback

# evaluate(func)

View Source

    @callback evaluate(func :: map()) :: :unknown | {:known, term()}

Link to this callback

# new(list)

View Source

    @callback new([term()]) :: {:ok, term()} | {:error, String.t() | Exception.t()}

Link to this callback

# private?()

View Source

    @callback private?() :: boolean()

# Link to this section Functions

Link to this function

# new(mod, args)

View Source
Link to this function

# ordinal(num)

View Source

Attaches the appropriate suffix to refer to an ordinal number, e.g 1 -> "1st"

Link to this function

# try_cast_arguments(configured_args, args)

View Source