From: Randy Kramer Date: 2007-10-27T20:35:41+09:00 Subject: Re: .each do |foo, bar| what does bar do? On Saturday 27 October 2007 06:57 am, Thufir wrote: > I just can't wrap my mind around *what's* being iterated through. I > guess it's the way that, as you put it, the "yield(current_hash_key, > current_hash_value)" is happening behind the scenes. Well, let's look at an example hash: { "key1"=>"value1", "key2"=>"value2", "cow"=>"bovine", 12=>"dodecine" } A hash (literal) is "a list of key => value pairs between braces" (from pickaxe2). When you iterate through the hash, you are iterating through the key=>value *pairs*--on the first iteration you get the values "key1"=>"value1", on the 2nd iteration you get "key2"=>"value2", and so on. Note that you get *two* values. Randy Kramer