From: Eugen Ciur Date: 2010-08-30T15:39:36+09:00 Subject: case (variable) when type1 ... when type2 ... end Hi all, how can I write case statement to check of specific type the variable has? Something like: case var when :Fixnum puts "#{var} is Fixnum" when :String puts "#{var} is String" end I tried this also case var.class when 'Fixnum' puts "#{var} is Fixnum" when 'String' puts "#{var} is String" end but ruby refuses to understand me :( What is the best way to write conditional that depends of variable type? Thank you!