Skip to content

Instantly share code, notes, and snippets.

@0x0dea

0x0dea/wtf.rb Secret

Created July 9, 2015 15:08
Show Gist options
  • Save 0x0dea/7fd377af0fbfe8c13ed9 to your computer and use it in GitHub Desktop.
Save 0x0dea/7fd377af0fbfe8c13ed9 to your computer and use it in GitHub Desktop.
module Foo
refine Object do
def method_missing *args
args
end
end
refine Object.singleton_class do
def const_missing const
const
end
end
end
using Foo
foo 1, 2, 3 #=> [:foo, 1, 2, 3]
FOO #=> NameError :(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment