title: Ruby iterate through hash and compare value pairs
body: <p>My Ruby assignment is to iterate through a hash and return the key associated with the lowest value, <em>without</em> using any of the following methods:</p>
  
  <pre><code>#keys #values #min #sort #min_by
  </code></pre>
  
  <p>I don't understand how to iterate through the hash and store each pair as it comes through, compare it to the last pair that came through, and return the lowest key.  This is my code to show you my thought process, but it of course does not work.  Any thoughts on how to do this? Thanks!</p>
  
  <pre><code>def key_for_min_value(name_hash)
    index = 0 
    lowest_hash = {}
  
    name_hash.collect do |key, value|
      if value[index] &lt; value[index + 1]
        lowest = value
        index = index + 1 
        key_for_min_value[value]
  
        return lowest
      end
    end
  end 
  </code></pre>