title: How to get integer index from named order
body: <p>This might be really obvious but I can't find the answer.</p>
  
  <p>How do you get the integer index from named order, like:</p>
  
  <pre><code>{ :first =&gt; 0, :second =&gt; 1, :third =&gt; 2, :fourth =&gt; 3 }
  </code></pre>
  
  <p>Is there something built in to Ruby or Rails that does this?</p>
  
  <p>Thanks.</p>
  
  <p><strong>Update</strong></p>
  
  <p>Thanks for all your responses. Here's the solution I went with: </p>
  
  <pre><code>def index_for(position) 
    (0..4).to_a.send(position)
  end
  </code></pre>
  
  <p>but arrays only support up to fifth, so it'll be limited to that.</p>