ecto_fields v0.0.1 EctoFields.IP

Summary

Functions

Validate that the given value is a valid ip

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(ip)

Validate that the given value is a valid ip

## Examples

iex> EctoFields.IP.cast(“192.168.10.1”) “192.168.10.1”

iex> EctoFields.IP.cast(“http://example.com”) :error

iex> EctoFields.IP.cast(“2001:1620:28:1:b6f:8bca:93:a116”) “2001:1620:28:1:b6f:8bca:93:a116”

dump(ip)

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

load(ip)

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

type()

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