Confusingly, the Ruby case uses === to compare each case with an object. Class#=== tests for instances of this class, but not the class itself:
> Fixnum === Integer false > Fixnum === 1 true
The case behavior that Ruby is trying to advertise:
case "Hello" when Integer puts "A" when String puts "B" else puts "C" end
source share