Created
August 26, 2010 23:55
-
-
Save jgagner/552495 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
#mostly pseudo-code | |
#LOLOLOL | |
class Module | |
alias_method :old_method_missing, :method_missing | |
def method_missing(methId) | |
methods = methId.split("_") | |
tmp = self | |
while methods.size > 0 | |
my_meth = methods.pop | |
if tmp.respond_to?(my_meth) | |
tmp = tmp.send(my_meth) | |
else | |
old_method_missing(methId) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment