Skip to content

Instantly share code, notes, and snippets.

@s3itz
Created February 8, 2014 06:58
Show Gist options
  • Save s3itz/8877757 to your computer and use it in GitHub Desktop.
Save s3itz/8877757 to your computer and use it in GitHub Desktop.
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