Box.Fraction.EctoType (box v0.15.1)

View Source

Ecto type for Fraction. The Fraction type is expected to be stored as a fraction type which is a composite Postgres type.

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.

Functions

cast(fraction)

@spec cast(Box.Fraction.t() | {integer(), integer()} | {String.t(), String.t()}) ::
  :error | {:ok, Box.Fraction.t()}

Callback implementation for Ecto.Type.cast/1.

dump(fraction)

@spec dump(any()) :: :error | {:ok, {integer(), String.t()}}

Callback implementation for Ecto.Type.dump/1.

embed_as(_)

Callback implementation for Ecto.Type.embed_as/1.

equal?(term1, term2)

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

load(arg)

@spec load({integer(), integer()}) :: {:ok, Box.Fraction.t()}

Callback implementation for Ecto.Type.load/1.

type()

@spec type() :: :fraction

Callback implementation for Ecto.Type.type/0.