当然といえば当然だが
# Here your code ! a = { hoge: { piyo: 111 } } b = { hoge: { piyo: 222, fuga: { foo: 333 } } } p a.merge(b) p b.merge(a)
結果
{:hoge=>{:piyo=>222, :fuga=>{:foo=>333}}} {:hoge=>{:piyo=>111}}
当然といえば当然だが
# Here your code ! a = { hoge: { piyo: 111 } } b = { hoge: { piyo: 222, fuga: { foo: 333 } } } p a.merge(b) p b.merge(a)
結果
{:hoge=>{:piyo=>222, :fuga=>{:foo=>333}}} {:hoge=>{:piyo=>111}}