有什么比这简单的方法
if hash.key?('a') hash['a']['b'] = 'c' else hash['a'] = {} hash['a']['b'] = 'c' end
ruby hash variable-assignment autovivification hash-of-hashes
autovivification ×1
hash ×1
hash-of-hashes ×1
ruby ×1
variable-assignment ×1