xema v0.1.1 Xema.Number View Source
This module contains the struct for the keywords of type number
.
Usually this struct will be just used by xema
.
Examples
iex> import Xema
Xema
iex> schema = xema :number
%Xema{type: %Xema.Number{}}
iex> schema.type == %Xema.Number{}
true
Link to this section Summary
Link to this section Types
Link to this type
t()
View Source
t() :: %Xema.Number{as: atom(), enum: list() | nil, exclusive_maximum: boolean() | nil, exclusive_minimum: boolean() | nil, maximum: integer() | nil, minimum: integer() | nil, multiple_of: number() | nil, type: term()}
The struct contains the keywords for the type number
.
as
is used in an error report. Default ofas
is:number
enum
specifies an enumerationexclusive_maximum
is a boolean. When true, it indicates that the range excludes the maximum value.exclusive_minimum
is a boolean. When true, it indicates that the range excludes the minimum value.maximum
the maximum valueminimum
the minimum valuemultiple_of
is a number greater 0. The value has to be a multiple of this number.