Use Class#kind_of? instead of ==

WRT rapid#2915