Elex.Labels (Elex v0.2.1)
View SourceProvides human-readable labels for expression types.
Used by Elex.Validator and Elex.Evaluator
when formatting type error messages.
This module can be extended by applications to provide localized labels using Gettext.
Supported types
| Type | Label |
|---|---|
:decimal | "number" |
:string | "text" |
:boolean | "yes/no" |
nil | "empty" |
:unknown | "value" |
Summary
Functions
Returns a human-readable label for an expression type.
Functions
Returns a human-readable label for an expression type.
Can be overridden in applications that use Gettext for localization.
Parameters
type- An expression type atom (:decimal,:string,:boolean, or:unknown)
Returns
A short human-readable label string.
Examples
label(:decimal)
#=> "number"
label(:boolean)
#=> "yes/no"