Last active
August 29, 2015 14:06
-
-
Save tamird/977a7bb9c53b37298011 to your computer and use it in GitHub Desktop.
Real constants in Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Module.send( | |
:prepend, | |
Module.new do | |
def const_set(p1, p2) | |
p2.freeze unless p2.is_a?(Module) | |
super | |
end | |
end | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment