Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created May 13, 2016 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/af2377e28aa788b5dddba48f3e33a4cb to your computer and use it in GitHub Desktop.
Save anonymous/af2377e28aa788b5dddba48f3e33a4cb to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
klass = Class.new do
def hello
puts MY_CONST
end
end
klass.const_set 'MY_CONST', Time.now
Object.const_set 'HelloClass', klass
HelloClass.new.hello
# => uninitialized constant MY_CONST (NameError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment