Skip to content

Instantly share code, notes, and snippets.

@BitOfUniverse
Created March 28, 2019 12:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BitOfUniverse/6344753c98a5880d43682c8505232ac2 to your computer and use it in GitHub Desktop.
Save BitOfUniverse/6344753c98a5880d43682c8505232ac2 to your computer and use it in GitHub Desktop.
Ruby infinitely nested hash
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