I have this:
hash = { "a"=>["a", "b", "c"], "b"=>["b", "c"] }
and I want to get to this: [["a","b","c"],["b","c"]]
This seems like it should work but it doesn't:
hash.each{|key,value| value}
=> {"a"=>["a", "b", "c"], "b"=>["b", "c"]}
Any suggestions?
hash.valuesbeing the better IMO). But I wanted to point out when you provide a block toHash#eachit will just return the full value of the hash. If you want to do an operation on each item and return that as an array, useHash#collector its aliasHash#map. More stuff on Enumerables here.