Ruby Tip #3: Matching on an Object's Class in a Case Expression
From time to time you might want to take different actions depending on an object’s class. One handy way to do so is with a case expression: case object when Fixnum then puts 'Object is an integer...