From: William Djaja Tjokroaminata Date: 2002-04-12T23:37:48+09:00 Subject: Re: Why Object#class Is Inconsistent in "==" and "case"? Hi Guy, It works! Thanks. Just curious, how do you know all the smallest details like this? From experience, or from some written documentation? I have read most of the "Programming Ruby" book, but still missed this case. Also, what is your opinion regarding the Principle of Least Surprise in this matter? At least I was surprised :) Bill ============================================================== ts wrote: > case obj # it's shorter to write :-) > W> when MyClass > W> puts "Using case it is OK too" > W> when MyModule::MyClass > W> puts "Using case has to use the module name" > W> else > W> puts "The class name is #{obj.class}" > W> end > Guy Decoux