Last Updated: February 25, 2016
·
475
· kibenimatik

Hash magic

1.9.3p286 :001 > h = Hash.new {|h,k| h[k] = Hash.new(&h.default_proc)}
=> {}
1.9.3p286 :002 > h[1][2][3]=:test
=> :test
1.9.3p286 :003 > h
=> {1=>{2=>{3=>:test}}}