MaxoMacro
provides useful macros to simplify your code.
MaxoMacro.import_with_delegates
generates public delegates for all functions on the source module.
defmodule Source do
def hey(name), do: "Hey, #{name}!"
end
defmodule Target do
require MaxoMacro
MaxoMacro.import_with_delegates(Source)
end
Target.hey("Joe")
# => Hey, Joe!
The package can be installed by adding maxo_macro
to your list of dependencies in mix.exs
:
def deps do
[
{:maxo_macro, "~> 0.1"}
]
end
The docs can be found at https://hexdocs.pm/maxo_macro.