is

.is( klass )

This is for checking if an object matches the type given. It returns true if the object is of the type stated, and false if it is not.

The klass can be a symbol or a string, of the class name to test for.

class Car
    // code omitted
end
   
class Bus
    // code omitted
end
    
obj = new Car()
    
obj.is( :car  ) // returns true
obj.is( "car" ) // returns true
obj.is( :bus  ) // returns false