Created
October 30, 2012 02:36
-
-
Save waynerobinson/3977981 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
module MyMixin | |
def test_constant | |
puts MY_CONSTANT | |
end | |
end | |
class Foo | |
MY_CONSTANT = "BLAH" | |
include MyMixin | |
end | |
foo = Foo.new | |
# Will raise "uninitialized constant MyMixin::MY_CONSTANT (NameError)" | |
foo.test_constant |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment