From: Michael Morin Date: 2010-09-03T16:07:15+09:00 Subject: Re: case (variable) when type1 ... when type2 ... end No, it's not a special behavior. Explanation is here. http://ruby.about.com/od/beginningruby/qt/On-Case-And-Class.htm On Fri, Sep 3, 2010 at 1:25 AM, tilde wrote: > On 08/30/10 10:33, Jean-Julien Fleck wrote: >>> >>> how can I write case statement to check of specific type the variable >>> has? >>> Something like: >> >> It simpler: >> >>> case var >>> when :Fixnum >>>  puts "#{var} is Fixnum" >>> when :String >>>  puts "#{var} is String" >>> end >> >> case var >> when Fixnum >>  puts "#{var} is Fixnum" >> when String >>  puts "#{var} is String" >> end >> >> (no ":") >> >> Cheers, >> > > Hi, could you explain me why this works? It's a special behaviour of the > "case" statment? > >