From: Ruby Rabbit Date: 2009-01-07T14:58:15+09:00 Subject: Could not understand this: 3.class is Fixnum or Class I stored the class of a variable in a variable and later checked in a switch-case. Instead of going into the Fixnum case, it goes into ELSE. c=23.class # => Fixnum c == Fixnum # => true case c; when Fixnum; puts "YES"; else; puts "NO"; end # => prints NO # after much head-scratching tried this: case c; when Fixnum; puts "YES"; when Class; puts "CLASS"; else; puts "NO"; end # prints CLASS --- As a result of this I had to store the class as a string (to_s), so the case could work. Could someone explain what I am missing here. Thx. -- Posted via http://www.ruby-forum.com/.