Last active
April 13, 2016 07:57
Star
You must be signed in to star a gist
Model Support Function Extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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