RichardOnRails wrote:
> def parents(obj)
>   ( (obj.superclass ? parents(obj.superclass) : []) << obj). reverse
> end
> [...]
> parents(Class).inspect  =>  [Class, Object, Module]
> 			Expected:  [Class, Module, Object]

Ok, here's what happens:
parents(Class)  = (parents(Module) << Class).reverse
parents(Module) = (parents(Object) << Module).reverse
parents(Object) = [Object]
parents(Module) = ([Object] << Module).reverse
                = [Module, Object]
parents(Class)  = ([Module, Object] << Class).reverse
                = [Module, Object, Class].reverse
                = [Class, Object, Module]

Anyway, do you know that you can get what you want just by calling 
TheClass.ancestors? Well, not quite as that also includes included
modules, but TheClass.ancestors.grep(Class) would give you exactly
the results you expected from your method. 

HTH,
Sebastian
-- 
NP: Obituary - I'm in Pain
Jabber: sepp2k / jabber.org
ICQ: 205544826