【发布时间】:2013-08-20 07:49:15
【问题描述】:
现在,我正在合并两个这样的哈希:
department_hash = self.parse_department html
super_saver_hash = self.parse_super_saver html
final_hash = department_hash.merge(super_saver_hash)
输出:
{:department=>{"宠物用品"=>{"鸟类"=>16281, "猫"=>245512, "狗"=>513926, "鱼和水生宠物"=>46811, "马"=>14805, "昆虫"=>364, "爬行动物和两栖动物"=>5816, "小 动物"=>19769}}, :super_saver=>{"免费超级保护 运费"=>126649}}
但现在我想在未来合并更多。例如:
department_hash = self.parse_department html
super_saver_hash = self.parse_super_saver html
categories_hash = self.parse_categories html
如何合并多个哈希?
【问题讨论】:
-
+1 好问题..