View Source Arke.Core.Parameter (Arke v0.1.35)

Module to manage the defaults parameter

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

Types

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

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:

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

Summary

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()