title: Ruby inject until sum exceeds a set value and return the index where this occurs
body: <p>With the following array and value:</p>
  
  <pre><code>v = 50
  a = [10, 20, 25, 10, 15]
  </code></pre>
  
  <p>I want to iterate through the array adding up the values until the sum of these values exceeds the variable v. And then I want to be able to return the index in the array where that occurred. so...</p>
  
  <p>10 + 20 + 25 = 55 (which is the first point which the sum is greater that 'v')
  so index = 2</p>
  
  <p>Thanks for your help</p>