instance_of « Reflection « Ruby






1.if an object is an instance of a given class with the instance_of? method from Object
2.Use instance_of? for robustness.
3.Unlike instance_of?, is_of? or kind_of? also work if the argument is a superclass or module.
4.Is it a string class instance
5.Is it a number
6.Use === to check the class type