Subject: Re: Tricky problem with ===
From: Stefan Rusterholz <apeiros gmx.net>
Date: Sun, 27 May 2007 23:24:00 +0900
References: 253170
In-reply-to: 253170
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
--
Posted via http://www.ruby-forum.com/.