Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement