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"}
]
endThe docs can be found at https://hexdocs.pm/delegate.
Usage
use Delegate provides the following macros:
defmacrodelegate, likedefdelegatebut for macros (happens at compile time). Supports same options asdefdelegatedefdelegateall(MyModule, only: [myfun: 1])creates delegates for all functions inMyModule. Supportsonlyandexceptoptionsdefmacrodelegatealllikedefdelegateallbut for macrosdefmoduledelegateutility that runs bothdefdelegateallanddefmacrodelegateall, supportsonlyandexcept