title: how do I prepend an integer in an array of strings using ruby?
body: <p>I have an array created by the following ruby code in a method:</p>
  
  <pre><code>array[i] = {:key =&gt; response.body['results'][i]['path']['key'],  
                :value =&gt; response.body['results'][i]['value'],
                :epoch_time =&gt; response.body['results'][i]['path']['reftime'] / 1000}
  array[i][:collection] = response.body['results'][i]['path']['collection']
  </code></pre>
  
  <p>I would like another method <code>.enumerate_array</code> or something which goes through an appends "i -" which i is the corresponding index value of the array.</p>
  
  <p>For example, for <code>array[0][:value] = "this was the first answer"</code>.</p>
  
  <p>Then:</p>
  
  <p><code>array = enumerate_array(array)</code> </p>
  
  <p><code>=&gt; array[0][:value] = "0 - this was the first answer"</code></p>
  
  <p>Thanks.</p>