How do the parameters in ruby '.each do' for-loops work? <p>What's confusing me in the code below is how the parameters <code>state</code> and <code>abbrev</code> match up with the keys and and the values of the hash? Or in other words, how is <code>state</code> matched up with <code>'oregon'</code> and <code>abbrev</code> with <code>'OR'</code> (if the parameters matched words in the hash, then I could understand that)</p> <p>Are they matched up correctly because the first parameter is paired with the first value in the code block?</p> <pre><code>states = { 'Oregon' =&gt; 'OR', 'Florida' =&gt; 'FL', 'California' =&gt; 'CA', 'New York' =&gt; 'NY', 'Michigan' =&gt; 'MI' } states.each do |state, abbrev| puts "#{state} is abbreviated #{abbrev}" end </code></pre> <p>The output of this code:</p> <pre><code>Oregon is abbreviated OR Florida is abbreviated FL California is abbreviated CA New York is abbreviated NY Michigan is abbreviated MI </code></pre> <p>Sorry for not being able to put my question across clearly, still new to this :S</p> <p>Thanks!</p>