Created
March 28, 2019 12:22
-
-
Save BitOfUniverse/6344753c98a5880d43682c8505232ac2 to your computer and use it in GitHub Desktop.
Ruby infinitely nested hash
This file contains hidden or 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
hash = Hash.new {|h, k| h[k] = Hash.new(&h.default_proc) } | |
hash[:this][:is][:really] = 'Amazing!' | |
hash | |
=> {:this=>{:is=>{:really=>"Amazing!"}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment