EctoPhoneNumber (EctoPhoneNumber v0.4.4) View Source

Phone number type with validation and formatting for Ecto.

Link to this section Summary

Functions

Callback implementation for Ecto.Type.cast/1.

Callback implementation for Ecto.Type.dump/1.

Callback implementation for Ecto.Type.embed_as/1.

Callback implementation for Ecto.Type.equal?/2.

Callback implementation for Ecto.Type.load/1.

Callback implementation for Ecto.Type.type/0.

Link to this section Types

Specs

t() :: %EctoPhoneNumber{e164: term()}

Link to this section Functions

Specs

cast(any()) :: {:ok, t() | nil} | :error

Callback implementation for Ecto.Type.cast/1.

Specs

dump(any()) :: :error | {:ok, binary()}

Callback implementation for Ecto.Type.dump/1.

Specs

embed_as(any()) :: :self

Callback implementation for Ecto.Type.embed_as/1.

Specs

equal?(any(), any()) :: boolean()

Callback implementation for Ecto.Type.equal?/2.

Link to this function

format(ecto_phone_number, format \\ :international)

View Source

Specs

format(t() | nil, atom()) :: binary()

Specs

load(binary()) :: :error | {:ok, t()}

Callback implementation for Ecto.Type.load/1.

Specs

type() :: :string

Callback implementation for Ecto.Type.type/0.