title: return value from loop
body: <p>I have a hash <code>@hsh={a:1,b:2}</code>
   and want to return a port 
  but it returns to me <code>{a:1,b2}</code></p>
  
  <pre><code>  def my_def(port)
     @hsh.each do |k,v|
        if v == port
         port = k
        end
      end
    end
  </code></pre>
  
  <p>My problem is when i doing  <code>my_def(2)</code> it do not returns me <code>'b'</code> and i</p>
  
  <p>got whole hash back <code>=&gt;{a:1,b:2}</code></p>