From: Ezra Zygmuntowicz Date: 2007-05-28T05:34:23+09:00 Subject: Re: Tricky problem with === On May 27, 2007, at 7:24 AM, Stefan Rusterholz wrote: > Erwin Abbott wrote: >> case x >> when Array puts "Array" >> when Proxy puts "Proxy" >> end > > Ugly, but you could try: > puts case [x.class] > when [Array]: "Array" > when [Proxy]: "Proxy" > else "Hu?" > end > > Regards > Stefan case uses === to match when clauses. Therefor you can do it like this: case x when Array puts "Array" when Proxy puts "Proxy end Cheers- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez@engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273)