Is there any way simpler than
if hash.key?(\'a\') hash[\'a\'][\'b\'] = \'c\' else hash[\'a\'] = {} hash[\'a\'][\'b\'] = \'c\' end
a simple one, but hash should be a valid hash object
(hash["a"] ||= {})['b'] = "c"