Hello,
I’m trying to iterate over a hash map I created, but its not working
very well… I’ve been experimenting in IRB like so:
compare_hash = {}
compare_hash[“item1”] = [“subitem1”,“subitem2”]
compare_hash[“item2”] = [“subitem1”,“subitem2”]
compare_hash.each do |item|
puts item[0]
end
instead of giving me the expected results of:
subitem1
subitem2
it gives me only the names:
item1
item2
Does anybody know how to do this properly?
Thanks!
- Jeff M.