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

Module that define the struct of a String by extending the Arke.Core.Parameter.base_parameters()

{arke_struct} = Parameter.String

element-added

Element added

  • min_length => :atom => define the min_length the string could have. It will check during creation
  • max_length => :atom => define the max_length the string could have. It will check during creation
  • values => [list] || [%{label: string, value: any}, ...] => use this to create a parameter with only certain values assignable. (Values must be the same type as the parameter we want to create)
  • multiple => boolean => relevant only if values are set. It makes possible to assign more than a values defined in values
  • unique => boolean => check if there is an existing record in the database with the same value before creating one
  • default => String => default value

example

Example

iex> params = [id: :string_test, min_length: 1, values: ["value1", "value2"], multiple: true]
...> Arke.Core.Parameter.new(%{type: :string, opts: params})

return

Return

%Arke.Core.Parameter.String{}

Link to this section Summary

Link to this section Functions

Link to this function

after_get_struct(arke, struct)

View Source
Link to this function

after_get_struct(arke, unit, struct)

View Source
Link to this function

before_create(arke, unit)

View Source
Link to this function

before_delete(arke, unit)

View Source
Link to this function

before_load(data, persistence_fn)

View Source
Link to this function

before_struct_encode(_, unit)

View Source
Link to this function

before_update(arke, unit)

View Source
Link to this function

before_validate(arke, unit)

View Source
Link to this function

on_load(data, persistence_fn)

View Source
Link to this function

on_struct_encode(_, _, data, opts)

View Source
Link to this function

on_update(arke, old_unit, unit)

View Source