From: Jason Lillywhite Date: 2009-08-13T04:57:59+09:00 Subject: Re: Class#descendants? Robert Klemme wrote: > ObjectSpace.each_object(Class) do |cl| > cl.superclass.ancestors.each {|scl| h[scl] << cl} > end I'm getting this error: irb(main):085:0> ObjectSpace.each_object(Class) do |cl| irb(main):086:1* cl.superclass.ancestors.each {|scl| h[scl] << cl} irb(main):087:1> end NoMethodError: undefined method `ancestors' for nil:NilClass from (irb):86 from (irb):85:in `each_object' from (irb):85 from :0 Is there a reason superclass is returning nil on cl? -- Posted via http://www.ruby-forum.com/.