From: Robert Klemme Date: 2006-02-03T01:18:18+09:00 Subject: Re: Class vs. Object James Herdman wrote: > Here we go again =) (I fairly sure I've almost got it now) > >> (i) >>>> Class.superclass >> => Module >>>> Class.ancestors >> => [Class, Module, Object, Kernel] > > Do I understand the Class.ancestors relationship to mean "those > classes which are implemented by the Class class"? (I had to remind > myself that Ruby isn't really single inheritance -- it has mixins and > whatnot) Yes, all superclasses and mixed in modules (see example below). > e.g. > > String.ancestors > => [String, Enumerable, Comparable, Object, Kernal] > > Do I understand Class.superclass to mean the class *directly* > subclassed to form said class? Exactly. And ancestors includes also modules: >> module Mix;end => nil >> class Base;end => nil >> class Sub < Base >> include Mix >> end => Sub >> Sub.ancestors => [Sub, Mix, Base, Object, Kernel] >> Sub.superclass => Base Kind regards robert