ecto_fields v1.3.0 EctoFields.URL

Link to this section Summary

Functions

Validate that the given value is a valid fully qualified url

Callback implementation for Ecto.Type.dump/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 Functions

Validate that the given value is a valid fully qualified url

Examples

iex> EctoFields.URL.cast("http://example.com")
{:ok, "http://example.com"}

iex> EctoFields.URL.cast("https://example.com")
{:ok, "https://example.com"}

iex> EctoFields.URL.cast("http://example.com/test/foo.html?search=1&page=two#header")
{:ok, "http://example.com/test/foo.html?search=1&page=two#header"}

iex> EctoFields.URL.cast("myblog.html")
:error

iex> EctoFields.URL.cast("http://example.comlogirst")
:error

Callback implementation for Ecto.Type.dump/1.

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

Callback implementation for Ecto.Type.load/1.

Callback implementation for Ecto.Type.type/0.