Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Auto-creating nested hashes via recursive proc

View gist:3439466
1 2 3 4
hash = lambda { |h, k| h[k] = Hash.new &hash }
x = Hash.new &hash
x[1][2][3][4][5] = 6
x #=> {1=>{2=>{3=>{4=>{5=>6}}}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.