View Source Arke.Core.Parameter (Arke v1.1.33)

Module to manage the defaults parameter

In order to create a new one simply use the .new(opts)

types

Types

  • string
  • integer
  • float
  • boolean
  • dict
  • date
  • time
  • datetime

values

Values

There are two possible ways to declare the values for a parameter:

  • list => by giving a list of values

    values: ["value 1", "value 2", ...."value n"]
  • list of map => by giving a list of map. Each map must contain label and value.

    values: [%{label:"value 1", value: 1},... %{label: "value 999", value: 999}]

The result will always be a list of map containing label and value. Keep in mind that if the values are provided using a list the label will be autogenerated. Remember also that all the values provided must be the same type as the ParameterType and only string, integer and float support the values declaration

get-list-of-attributes-definable-in-opts-during-creation

Get list of attributes definable in opts during creation:

iex> Arke.Core.Parameter.'ParameterType'.get_parameters()

Link to this section Summary

Link to this section Types

@type parameter_struct() ::
  Arke.Core.Parameter.Boolean.t()
  | Arke.Core.Parameter.String.t()
  | Arke.Core.Parameter.Dict.t()
  | Arke.Core.Parameter.Integer.t()
  | Arke.Core.Parameter.Float.t()