From: Robert Dober Date: 2007-06-17T04:46:12+09:00 Subject: Re: Error in ancestor? On 6/16/07, John Joyce wrote: > If you're expecting it to return true, it can't. Everything in the > array is an instance, not the class itself. > > Getting bitten by my didactic skills ;) John please have a look at Morton's code, he was so kind to explain what I am worried about much clearer. That said maybe I can make things clearer myself: irb(main):001:0> a = class A; ancestors end => [A, Object, Kernel] irb(main):002:0> a.include? A => true irb(main):003:0> B = Class::new => B irb(main):004:0> Bsingle = class << B ; self end => # irb(main):005:0> b = Bsingle.ancestors => [#, #, Class, Module, Object, Kernel] #Ah too bad my patched Ruby, I gotta recompile, sorry, normally the singletons are #not in ancestor, please execute the code yourself to see the difference. irb(main):006:0> b.include? Bsingle => true Cheers Robert -- You see things; and you say Why? But I dream things that never were; and I say Why not? -- George Bernard Shaw