Created
December 14, 2008 16:49
-
-
Save Sixeight/35721 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
# Class#meta..class | |
class Class | |
def method_missing(meth, *args) | |
unless meth.to_s =~ /\A((?:meta)+)class\z/ | |
super | |
end | |
level = $1.gsub(/meta/).count | |
level.times.inject(self) {|klass, _| class << klass; self end } | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment