hoodwink.d enhanced

Sat Jan 7

I Googled you recently and I deeply enjoyed your website. You’re really narcissistic. I mean that in a very good way.

My friend, who is a “Psychoanalytic Psychotherapist”

Tip Filter collections by class with Enumerable#grep

Enumerable#grep uses the === operator internally, so in addition to matching each value in a collection against a regular expression, you can match against a class too.

>> [1.2, 3, ‘5’, nil, 7].grep(Numeric)
=> [1.2, 3, 7]