Ruby - Variables and Data Types
Which method would you use to check if an object is an instance of a specific class or its subclass in Ruby?
.is_a? method.is_a? returns true if the object is an instance of the given class or its subclass..instance_of? checks only exact class, .class returns class, .superclass returns superclass..is_a? checks class or subclass [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions