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
Link to this function
cast(url)
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.comlogirst")
:error
Link to this function
dump(url)
Callback implementation for Ecto.Type.dump/1
.
Link to this function
embed_as(_)
Link to this function
equal?(a, b)
Callback implementation for Ecto.Type.equal?/2
.
Link to this function
load(url)
Callback implementation for Ecto.Type.load/1
.
Link to this function
type()
Callback implementation for Ecto.Type.type/0
.