obj.instance_of?(class) â true or false
Instance Public methods
Returns true
if obj is an instance of the given
class. See also Object#kind_of?
.
1 2 3 4 5 6 7 8 | 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 |
Please login to continue.