From: ts Date: 2002-04-12T23:22:32+09:00 Subject: Re: Why Object#class Is Inconsistent in "==" and "case"? >>>>> "W" == William Djaja Tjokroaminata writes: Write it like this W> module MyModule W> class MyClass W> end W> obj = MyClass.new W> puts "Using == it is OK" if obj.class == MyClass W> case obj.class 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 W> case obj.class.name W> when 'MyModule::MyClass' W> puts "Using case has to use the module and class names" W> end W> end Guy Decoux