Is there anything more idiomatic than the following?
foo.class == String
In addition to the other answers, Class defines the method === to test whether an object is an instance of that class.