ecto_fields v0.0.2 EctoFields.PositiveInteger

Summary

Functions

Validate that the given value is a positive integer

Callback implementation for c:Ecto.Type.dump/1

Callback implementation for c:Ecto.Type.load/1

Callback implementation for c:Ecto.Type.type/0

Functions

cast(int)

Validate that the given value is a positive integer.

## Examples

iex> EctoFields.PositiveInteger.cast(1) 1

iex> EctoFields.PositiveInteger.cast(0) :error

iex> EctoFields.PositiveInteger.cast(-10) :error

dump(int)

Callback implementation for c:Ecto.Type.dump/1.

load(int)

Callback implementation for c:Ecto.Type.load/1.

type()

Callback implementation for c:Ecto.Type.type/0.