method
instance_of?

instance_of?(p1)
public
Returns true if obj is an instance of the given class. See also Object#kind_of?.
class A; end class B < A; end class C < B; end b = B.new b.instance_of? A #=> false b.instance_of? B #=> true b.instance_of? C #=> false