Class
Ais a subclass of ClassB. ClassBis a subclass of classC.ais an object of classA.bis an object of classB. Which ONE of the following Ruby expressions is NOT true?
b.respond_to?('class')a.superclass == b.classA.superclass == Ba.class.ancestors.include?(C)
The answer to this quiz question was (2).
I understand why (1), (3), and (4) are correct, but (2) is a bit confusing.
(2) is confusing because when I input a.superclass into irb, I got NoMethodError: undefined method 'superclass' for #<A:0x7fbdce1075f0>.
But when I input A.superclass == B into the irb, I get true.
Why can I call superclass on a class but not on the class's object?