View Source Shapex.Types.Number (shapex v0.3.1)
This module provides a type for validating numbers.
Existing validations:
- :gt - greater than
- :gte - greater than or equal to
- :lt - less than
- :lte - less than or equal to
- :eq - equal
- :neq - not equal
- :in - checks if the value is in a list
- :not_in - checks if the value is not in a list
It's better to use the Shapex.Types.number/1 function to create a schema, since it covers implementation details and provides a more user-friendly API.
Summary
Types
@type t() :: %Shapex.Types.Number{validations: [validation_rules()]}
@type target(a) :: a | {a, String.t()}