View Source Behaves (Behaves v0.1.0)
Behaves
allows you to check if an Elixir module implements a given
behaviour.
Summary
Functions
Returns the list of behaviours implemented by impl
.
Returns :ok
if the impl
implements the behaviour.
Returns :ok
if a given impl
implements the behaviour
or raises.
Returns true
if impl
implements the behaviour
or false
if it does not.
Functions
Returns the list of behaviours implemented by impl
.
Behaviours are sorted in the same order of @behaviour
s defined in the impl
module.
@spec like_a(impl :: atom(), behaviour :: atom()) :: :ok | {:not_implemented, {module(), module()}} | {:not_a_behaviour, module()} | {:not_a_module, atom()}
Returns :ok
if the impl
implements the behaviour.
In other cases, returns:
{:not_implemented, {impl, behaviour}}
if the implementation dos not implements the behaviour{:not_a_module, impl}
ifimpl
is not a module{:not_a_module, behaviour}
ifbehaviour
is not a module{:not_a_behaviour, behaviour}
ifbehaviour
is not a behaviour
Returns :ok
if a given impl
implements the behaviour
or raises.
Possible raised errors are:
ArgumentError
ifimpl
is not a moduleArgumentError
ifbehaviour
is not a moduleBehaves.NotImplementedError
ifimpl
does not implement thebehaviour
Returns true
if impl
implements the behaviour
or false
if it does not.