Skip to content

Instantly share code, notes, and snippets.

@jgagner
Created August 26, 2010 23:55
Show Gist options
  • Save jgagner/552495 to your computer and use it in GitHub Desktop.
Save jgagner/552495 to your computer and use it in GitHub Desktop.
#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