View Source Crontab.CronExpression.Ecto.Type (crontab v1.1.14)
Provides a type for Ecto usage.
The underlying data type should be a map.
Migration Example
create table(:my_table) do
add :schedule, :map
end
Schema Example
schema "my_table" do
field :schedule, Crontab.CronExpression.Ecto.Type
end
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
.
Types
@type map_expression() :: %{ extended: boolean(), reboot: boolean(), second: [Crontab.CronExpression.value(Calendar.second())], minute: [Crontab.CronExpression.value(Calendar.minute())], hour: [Crontab.CronExpression.value(Calendar.second())], day: [Crontab.CronExpression.value(Calendar.day())], month: [Crontab.CronExpression.value(Calendar.month())], weekday: [Crontab.CronExpression.value(Calendar.day_of_week())], year: [Crontab.CronExpression.value(Calendar.year())] }
Functions
@spec cast(any()) :: {:ok, Crontab.CronExpression.t()} | :error
Callback implementation for Ecto.Type.cast/1
.
@spec dump(any()) :: {:ok, Crontab.CronExpression.t()} | :error
Callback implementation for Ecto.Type.dump/1
.
Callback implementation for Ecto.Type.embed_as/1
.
Callback implementation for Ecto.Type.equal?/2
.
@spec load(any()) :: {:ok, Crontab.CronExpression.t()} | :error
Callback implementation for Ecto.Type.load/1
.
@spec type() :: :map
Callback implementation for Ecto.Type.type/0
.