Skip to content

Instantly share code, notes, and snippets.

@laserlemon
Created May 3, 2012 20:38
Show Gist options
  • Save laserlemon/2589072 to your computer and use it in GitHub Desktop.
Save laserlemon/2589072 to your computer and use it in GitHub Desktop.
"Patient" Evaluation
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