All intermediate-level hashtables will be created automagically
def autovivifying_hash
Hash.new {|ht,k| ht[k] = autovivifying_hash}
end
response_builder = autovivifying_hash
response_builder['payment']['status'] = 'OK'
response_builder # => {"payment"=>{"status"=>"OK"}
From us to your inbox weekly.