Sorry if this is obvious, I just don't get it. If I have an array of hashes like:
people = [{:name => "Bob", :occupation=> "Builder"}, {:name => "Jim", :occupation => "Coder"}]
And I want to iterate over the array and output lines like: "Bob: Builder". How can I do it? I understand how to iterate, but I'm still a little lost. Right now I have:
people.each do |person| person.each do |k,v| puts "#{v}" end end
My problem is that I do not understand how to return both values, only each value separately. What am I missing?
Thank you for your help.
source share