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

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