Created
August 19, 2010 01:23
-
-
Save dscataglini/536728 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hash = Hash.new(&(p = lambda{|hsh, key| hsh[key] = Hash.new(&p)})) | |
# now you can do this | |
hash[:this][:is][:very][:cool] = "Yeah baby, yeah ... " | |
#=> "Yeah baby, yeah ... " | |
hash | |
#=> {:this=>{:is=>{:very=>{:cool=>"Yeah baby, yeah ... "}}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment