Created
February 8, 2014 06:58
-
-
Save s3itz/8877757 to your computer and use it in GitHub Desktop.
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 SuperSillyHash | |
def []=(key, value) | |
super(key, value.to_i) | |
end | |
end | |
hash = {} | |
hash.extend(SuperSillyHash) | |
hash[:test] = '20' | |
puts hash[:test].class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment