Use Class#kind_of? instead of ==

WRT rapid7#2915