Skip to content

Instantly share code, notes, and snippets.

Created May 13, 2016 12:15
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/56cc6181bb8d45b238eefa0d154bfc0f to your computer and use it in GitHub Desktop.
Save anonymous/56cc6181bb8d45b238eefa0d154bfc0f 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.new.class.const_set 'MY_CONST', Time.now
Object.const_set 'HelloClass', klass
HelloClass.new.hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment