Created
March 21, 2015 03:04
-
-
Save edubkendo/b0422494f6b9bb2cbc9c to your computer and use it in GitHub Desktop.
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
# lib/my_app.ex | |
defmodule MyApp do | |
import MyApp.Blah | |
def foo do | |
# because we imported it, we can call the `bar` function directly | |
bar | |
end | |
end | |
# lib/my_app/blah.ex | |
defmodule MyApp.Blah do | |
def bar do | |
"something" | |
end | |
end | |
# lib/my_app/qux.ex | |
defmodule MyApp.Qux do | |
def baz do | |
# even without importing it, we can still call `bar` if we give the full module path | |
MyApp.Blah.bar | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment