title: Get array values using index key in Ruby on Rails
body: <p>I'm iterating through an array or hash, and I'd like to get values based on index.</p>
  
  <pre><code>@lv = {'apple' =&gt; ['round', 'red'], 'more names' =&gt; ['tags', 'more tags']}
  
  @lv.each do |key, value|
     # if the value is from the index key and equal to key itself...
  end
  </code></pre>
  
  <p>I'm not sure how to get the value from <code>@lv</code>. Lets say I want to get <code>apple</code>:</p>
  
  <p>Is there something like <code>@lv[0]</code> should equal apple? Because </p>
  
  <pre><code>[0] =&gt; apple
  [1] =&gt; more names
  </code></pre>
  
  <p>right?</p>
  
  <p>So I can</p>
  
  <pre><code>@lv.each do |key, value|
     if @lv[0] == key
       # apple equals apple, then proceed
     end
  end
  </code></pre>
  
  <p>What is the correct syntax on doing this?</p>
  
  <p>Thanks!</p>