Skip to content

Commit 184c38f

Browse files
committed
Apply changes to required_variable documentation
1 parent 3734c8b commit 184c38f

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

guides/configuration.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,32 +45,38 @@ where
4545
### `name`
4646
* **Syntax:** atom
4747
* **Example:** `name = var1`
48+
* **Default:** this field is mandatory
4849

4950
### `description`
5051
* **Syntax:** A string describing how this variable is used, can be extracted by APIs to document the behaviour
5152
* **Example:** `description = "a description of this variable"`
53+
* **Default:** this field is mandatory
5254

5355
### `default_value`
5456
* **Syntax:** value of the expected type
5557
* **Example:** `default_value = 10`
56-
57-
### `update`
58-
* **Syntax:** `read_only`, `none`, or an `mfa` of arity 2
59-
* **Example:** `update = {?MODULE, update, 2}`
60-
61-
An action to take when the value of this variable is updated.
62-
If it is set to `read_only`, updates will fail.
63-
If it is set to `none`, all updates are allowed.
58+
* **Default:** `undefined`
6459

6560
### `verification`
6661
* **Syntax:** `none`, a list of allowed values, or an `mfa` of arity `1`
6762
* **Example:** `verification = {?MODULE, is_binary, 1}`
63+
* **Default:** `none`
64+
65+
A verification function that will check the given value is correct. It is trigger for verifying the initial values, including the default value, and before updated values are applied.
66+
- If it is set to `none`, all values are allowed.
67+
- If it is set to a list of values, any given value checks that the new value is in such allowlist.
68+
- If it is an `mfa`, the given function will be called on the given value. This function
69+
must be pure and return a boolean or a `{true, NewValue} | {false, Reason}`. It can also be used for preprocessing of the input value by returning `{true, NewValue}`.
70+
71+
### `update`
72+
* **Syntax:** `read_only`, `none`, or an `mfa` of arity 2
73+
* **Example:** `update = {?MODULE, update, 2}`
74+
* **Default:** `read_only`
6875

69-
A verification function that will check the value given is correct.
70-
If it is set to `none`, all updates are allowed.
71-
If it is set to a list of values, any given value checks that the new value is in such whitelist.
72-
If it is an `mfa`, the given function will be called on the given value. This function
73-
must be pure and return a boolean or a `{true, NewValue} | {false, Reason}`.
76+
An action to take when the value of this variable is updated. It is triggered at runtime when updates to the value are applied.
77+
- If it is set to `read_only`, updates will fail.
78+
- If it is set to `none`, all updates are allowed.
79+
- If it is an `mfa`, the given function will be called on the old and new value.
7480

7581
## Reasonale
7682

0 commit comments

Comments
 (0)