Delegate
Provides utilities for delegating macros and entire functions and macros of another module
Installation
The package can be installed
by adding delegate
to your list of dependencies in mix.exs
:
def deps do
[
{:delegate, ">= 0.0.0"}
]
end
The docs can be found at https://hexdocs.pm/delegate.
Usage
use Delegate
provides the following macros:
defmacrodelegate
, likedefdelegate
but for macros (happens at compile time). Supports same options asdefdelegate
defdelegateall(MyModule, only: [myfun: 1])
creates delegates for all functions inMyModule
. Supportsonly
andexcept
optionsdefmacrodelegateall
likedefdelegateall
but for macrosdefmoduledelegate
utility that runs bothdefdelegateall
anddefmacrodelegateall
, supportsonly
andexcept