Is there any way simpler than
if hash.key?(\'a\') hash[\'a\'][\'b\'] = \'c\' else hash[\'a\'] = {} hash[\'a\'][\'b\'] = \'c\' end
The question here: Is auto-initialization of multi-dimensional hash array possible in Ruby, as it is in PHP? provides a very useful AutoHash implementation that does this.
AutoHash