From: Henry Maddocks Date: 2013-03-04T09:30:09+09:00 Subject: Re: Confusion with Ruby's "case/when" block statement On 4/03/2013, at 11:22 AM, "Kumar R." wrote: > > Now look at the above. Both return `true`. Does they output `true` on > the same logic? I think `NO`. `"abc".===("abc")` is just like simple > string literal comparison `"abc" ==("abc")` comparison. But > `String.===("abc")` outputs `true` as `"abc"` which is an instance of > `String`. > > Now my question is how ruby detects lefthand side operands types and > apply the proper rule of comparisons ? It doesn't detect anything.You are calling the === method on String, you have even written it as such `String.===("abc")`. Each class is free to implement it how ever they want. This is basic OO Henry