From: "Peña, Botp" Date: 2009-01-07T16:16:09+09:00 Subject: Re: Could not understand this: 3.class is Fixnum or Class From: Ruby Rabbit [mailto:sentinel.2001@gmx.com] # 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 case uses ===; thus on your case, it should be easier... eg try, > c=23 => 23 > case c; when Fixnum; puts "YES"; else; puts "NO"; end YES => nil > c="hello" => "hello" > case c; when Fixnum; puts "YES"; when String; puts "YES STRING!"; else; puts "NO"; end YES STRING! => nil