ash v1.24.1 Ash.Resource.Dsl.Calculate.Arguments.Argument View Source

Link to this section Summary

Functions

An argument to be passed into the calculation's arguments map

Link to this section Functions

Link to this macro

argument(name, type, opts \\ [])

View Source (macro)

An argument to be passed into the calculation's arguments map

Examples

argument :params, :map, default: %{}
argument :retries, :integer, allow_nil?: false

Arguments

  • :name - The name to use for the argument

  • :type - The type of the argument

Options

  • :default - false A default value to use for the argument if not provided

  • :allow_nil? - Whether or not the argument value may be nil The default value is true.

  • :constraints - Constraints to provide to the type when casting the value. See the type's documentation for more information. The default value is [].