From: Daniel Martin Date: 2006-08-09T23:28:43+09:00 Subject: Re: For Float#class why is '===' different from '==' "richB" writes: > I appreciate the responses. I'm still puzzled. It seems that "case a" > is different from "case a.class" and that the comparison being done by > "===" in when is influenced by the type/class of the when operand. Yes. The best way I have of mentally modelling === is this: lhs === rhs means "Does rhs match lhs?", where the definition of what matches depends of course on the nature of lhs. When lhs is a class object, it makes sense to say that 'match' means the same as 'is_a?'. When lhs is a range, it makes sense to say that 'match' means the same as 'includes?'. When lhs is a Regexp, 'match' already has a useful meaning.