How to break out from a ruby block?
Use the keyword next. If you do not want to continue to the next item, use break. When next is used within a block, it causes the block to exit immediately, returning control to the iterator method, which may then begin a new iteration by invoking the block again: When used in a block, break … Read more