[Comment] Re: Iterating over a Hash in Ruby

0
Your problem was that the block Hash#each takes is really looking for a |key, value| .

Your code should read:

h1.each { |key, val| … }

http://ruby-doc.org/core/classes/Hash.html#M000635

Leave a Reply

Your email address will not be published. Required fields are marked *

CommentLuv badge