Skip to content

Instantly share code, notes, and snippets.

@ream88
Created July 9, 2012 07:55
Show Gist options
  • Select an option

  • Save ream88/3074898 to your computer and use it in GitHub Desktop.

Select an option

Save ream88/3074898 to your computer and use it in GitHub Desktop.
Deep nested hashes in Ruby #snippet
h = Hash.new { |h,k| h[k] = Hash.new(&h.default_proc) }
h[:a][:b][:c] = "123"
h # => {:a=>{:b=>{:c=>"123"}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment