title: Delete an element from an Array based on a condition block and return that element
body: <p>Is there a quick Ruby or Rails method to delete an element from an Array based on a condition provided in a block and then return that element?</p>
  
  <p>Let's say, given:</p>
  
  <pre><code>e1.good? # false
  e2.good? # true
  e3.good? # true
  a = [e1, e2, e3]
  </code></pre>
  
  <p>Is there a method delete_and_return_if doing this:</p>
  
  <pre><code>a.delete_and_return_if { |e| e.good? }      # delete e2 from a and returns e2
  [e1].delete_and_return_if { |e| e.good? }   # returns nil
  </code></pre>
  
  <p>Or at least is there a clean way to do this?</p>