Ruby 2.5.0 was recently released. Ruby has sequence predicates such as all?, none?, one? and any? which take a block and evaluate that by passing every element of the sequence to it. 1if queries.any? { |sql| /LEFT OUTER JOIN/i =~ sql } 2logger.log "Left outer join detected" 3endCopy Ruby 2.5 allows using a shorthand for this by passing a pattern argument. Internally case equality operator(===) is
![Ruby 2.5 enumerable predicates accept pattern argument | BigBinary Blog](https://cdn-ak-scissors.b.st-hatena.com/image/square/df7dcf3e382d2d4b018ba79fc6642260e3fa7070/height=288;version=1;width=512/https%3A%2F%2Fres.cloudinary.com%2Fdpc4i4bdx%2Fimage%2Fupload%2Fbigbinary_blogs%2Fdefault_blog_image.png)