From: Patrick Gundlach Date: 2005-10-26T02:07:02+09:00 Subject: Re: Comparing Classes with Case ? > Just throwing in that it would not be a "BIG LOSS", not even a _big > loss_ or a big loss, because you nearly never should test for the > class of an object. Well, is the following the rare case of 'nearly never' or just stupidity? -------------------------------------------------- #!/opt/ruby/1.8/bin/ruby -w class AnonUser ; end class RegularUser < AnonUser ; end class Developer < RegularUser ; end class Guru < Developer ; end class Sysop < Guru ; end brian=Guru.new # ... if Developer===brian puts "ok, you are Developer" end if Sysop===brian puts "you may shutdown the server" end -------------------------------------------------- # -> ok, you are Developer Patrick