Model Support Function Extension
defmodule Nectar.ExtendProduct do | |
defmacro __before_compile__(_env) do | |
quote do | |
def fn_from_outside do | |
"support function" | |
end | |
end | |
end | |
end | |
defmodule Nectar.Product do | |
... | |
# Add new support function here | |
@before_compile Nectar.ExtendProduct | |
... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment