Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Using default proc to deeply, arbitrarily nest new Hash
h = {|hash, key| hash[key] =}
h[:foo][:bar][:baz][:bat] = "hello"
p h
#=> {:foo=>{:bar=>{:baz=>{:bat=>"hello"}}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.