Methods and Madness No. 2

.select  is fantastic for quick data searches. Recently I was faced with a problem in which I had to find certain, jumbled items in an array. This method made it a lot less daunting.

Rdocs | Stackoverflow

.drop_while  takes a block argument and filters return the values while it’s nil or false. It’s an Enumerable and behaves similarly to .reject, except it stops after after the first nil or false response it gets …because it breaks the while loop.

 Rdoc | Stackoverflow

Leave a Reply

Your email address will not be published. Required fields are marked *