=== Triple equal in ruby

a === b

It means If (a) describes a set, would (b) a member of that set?

(1..5) === 3           # => true
(1..5) === 6           # => false

Integer === 42          # => true
Integer === 'fourtytwo' # => false

/ell/ === 'Hello'     # => true
/ell/ === 'Foobar'    # => false
comments powered by Disqus