I don't think there's a better solution than what you already have.
There are different ones, of course - good ol' if..elsif..else chain,
a hash with classes being its keys ({String=>"I'm String class",
Fixnum=>"I'm an integer"}[klass] || "I'm nothing") - but I wouldn't
say they are better.

Maybe something else could be redone? Where does that class come from?

-- Matma Rex