Created
January 10, 2012 20:02
-
-
Save senny/1590866 to your computer and use it in GitHub Desktop.
const_missing and Class.new
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
class ThisWorks | |
def self.const_missing(*args) | |
p "yay!" | |
end | |
NonExistingConstant | |
end | |
this_does_not_work = Class.new do | |
def self.const_missing(*args) | |
p "yay!" | |
end | |
NonExistingConstant | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment