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

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() ::
  Parameter.Boolean.t()
  | Parameter.String.t()
  | Parameter.Dict.t()
  | Parameter.Integer.t()
  | Parameter.Float.t()

Link to this section Functions

Link to this function

before_unit_create(arke, unit)

View Source
Link to this function

before_unit_delete(arke, unit)

View Source
Link to this function

before_unit_load(arke, data, persistence_fn)

View Source
Link to this function

before_unit_update(arke, unit)

View Source
Link to this function

before_unit_validate(arke, unit)

View Source

Macro defining a shared struct of parameter used across Arkes

Link to this function

on_unit_create(arke, unit)

View Source
Link to this function

on_unit_delete(arg1, unit)

View Source
Link to this function

on_unit_load(arke, data, persistence_fn)

View Source
Link to this function

on_unit_struct_encode(unit, _)

View Source
Link to this function

on_unit_update(arg1, unit)

View Source
Link to this function

on_unit_validate(arke, unit)

View Source