Both superclass as well as ancestors should do the trick
Integer.ancestors would give you
[Integer, Precision, Numeric, Comparable, Object, Kernel]
Integer.superclass would give you
I guess, you’ll have to do some comparison after this.
On Tue, 4 Jun 2002, Matthias Veit wrote:
I miss a convenient way to ask a class, if it is a subclass of
a given superclass (like is_a?, kind_of? for instances).
I wish I could type something like:
Is there a possiblity, I did not know to achieve this?
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
Grabel’s Law: 2 is not equal to 3 – not even for large values of 2.