View Source Beacon.Types.Site (Beacon v0.3.3)

Sites are identified as atoms and stored as string in the database.

Summary

Types

t()

Atom to identify a site, eg: :my_site

Functions

Callback implementation for Ecto.Type.embed_as/1.

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

Returns true if site is valid, otherwise returns false.

Types

t()

@type t() :: atom()

Atom to identify a site, eg: :my_site

Functions

embed_as(_)

Callback implementation for Ecto.Type.embed_as/1.

equal?(term1, term2)

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

valid?(site)

Returns true if site is valid, otherwise returns false.

A site is valid if it's a atom with no special characters, except _.

Examples

iex> valid?(:my_site)
true

iex> valid?(:"my-site!")
false

valid_name?(site)

valid_path?(path)