Off the top of my head I'd just do this:

foo.each do |one,two|
foo[one] << bar[one]
foo[one].flatten!
foo[one].uniq!
end

-- 
Posted via http://www.ruby-forum.com/.