From: Pieter Hugo Date: 2010-07-06T20:21:08+09:00 Subject: WTF? Case statement disfunctional? Hi I have a simple problem with the class of an object not being recognised by the case statement. Am I just being an idiot again or is there something more sinister going on here? a=1 case a.class when Fixnum puts "It's a number silly" else puts "Can't figure it out" end This snippet of code returns "Can't figure it out" which is just wrong? a.is_a? Fixnum => true and a.class => fixnum and a.class == Fixnum => true, so why dont my case statement work? case a.class.to_s when "Fixnum" ... does the trick, but it just offends my aesthetics. Any ideas? Comments? Regards Pieter Hugo South Africa -- Posted via http://www.ruby-forum.com/.