Joined August 2012
·

Nicolas McCurdy

SSE
·
Rochester, NY
·
·
·

Posted to The rarely used === in Ruby over 1 year ago

From the (unofficial) Ruby Style Guide:

Avoid explicit use of the case equality operator ===. As it name implies it's meant to be used implicitly by case expressions and outside of them it yields some pretty confusing code.

# bad
Array === something
(1..100) === 7
/something/ === some_string

# good
something.is_a?(Array)
(1..100).include?(7)
some_string =~ /something/
Achievements
9 Karma
0 Total ProTip Views