Created
May 3, 2012 20:38
-
-
Save laserlemon/2589072 to your computer and use it in GitHub Desktop.
"Patient" Evaluation
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 MagicProxy | |
@methods = [] | |
def self.method_missing(method) | |
@methods << method | |
# Put magic here! | |
puts @methods.join('.') | |
self | |
end | |
end | |
# Should only puts "foo.bar.baz", not "foo" or "foo.bar" | |
MagicProxy.foo.bar.baz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment