From: Joe Van Dyk Date: 2006-03-23T12:27:11+09:00 Subject: Re: what on earth.. On 3/22/06, Mike Stok wrote: > > On 22-Mar-06, at 9:51 PM, Joe Van Dyk wrote: > > > a = 5 > > puts Fixnum == a.class # spits out true > > > > # spits out "Who knows what I am. :-(" > > case a.class > > when Fixnum > > puts "I'm a fixnum!" > > else > > puts "Who knows what I am. :-(" > > end > > > > > > What's going on here? > > case doesn't use == you can do this: > > a = 5 > > case a > when Fixnum > puts "I'm a fixnum" > else > puts "other" > end Very nice, thanks! Less code is always better.