title: How to break from a nested loop to a parent loop that is more than one level above which requires a value provided by the nested loop
body: <p>In the following situation:</p>
  
  <pre><code>xxx.delete_if do |x|
    yyy.descend do |y| # This is a pathname.descend
      zzz.each do |z|
        if x + y == z
          # Do something
  
          # Break all nested loops returning to "xxx.delete_if do |x|" loop
  
          # The "xxx.delete_if do |x|" must receive a "true" so that it
          # can delete the array item
        end
      end
    end
  end
  </code></pre>
  
  <p>What is the best way to achieve this multiple nested break while making sure I can pass the <code>true</code> value so that the array item is deleted?</p>
  
  <p>Maybe I should use multiple <code>break</code> statements that return <code>true</code> or use a <code>throw/catch</code> with a variable, but I don't know if those are the best answer.</p>
  
  <hr>
  
  <p>This question is different from <a href="https://stackoverflow.com/questions/5286861/how-to-break-from-nested-loops-in-ruby">How to break from nested loops in Ruby?</a> because it requires that the parent loop receives a value from the nested loop.</p>