On Dec 31, 2003, at 15:25, John W. Long wrote:

> ri Class#=== doesn't exist for 1.8.0 (I'm on windows).

Try Module#=== instead.


> Could you explain
> what you mean in further detail?
>
> I'm actually trying to do a case statement:
>
> case o.class
> case Array
>     puts "Array"
> ...
> else
>     puts "Something Else"
> end

#=== is really all about case statements, so it's already optimized for 
what you're trying to do. It'll do what you want if you just drop the 
call to #class:

   case o
   when Array
     puts "Array"
   else
     puts "Something Else"
   end

HTH,


Nathaniel

<:((><