title: Ruby: Delete and return an array value based on block find condition
body: <p>Is there a built-in way to delete a value from an array, based on a block condition returning true, and return the value that was deleted? </p>
  
  <p>This is a simplified version of what I'm trying to do, but it seems like there has to be a better way:</p>
  
  <pre><code>array = [1,2,3,4,5,6,7,8,9,10]
  
  index = array.index {|v| v == 5} # returns index if block is true
  
  value = array.delete_at(index) # deletes and returns element at index
  </code></pre>
  
  <p><code>value</code> is then 5 </p>