From: "Jan E." Date: 2012-07-16T05:53:01+09:00 Subject: Re: How to iterate over nested hashes? Andrew S. wrote in post #1068825: > But why can't I do this? (fails): > > c.values.each.values.each.each do |foo| > p foo > end Because that's not how "each" works. You cannot call a method on "each" in order to call it on every element. The "each" method without a block returns an Enumerator. So you'll either have to stick with the solution above or write your own method. Or you should rethink the structure of your data. A deeply nested hash or array is almost always bad design and should be replaced with with an appropriate object (like a table, a tree or whatever fits best). -- Posted via http://www.ruby-forum.com/.