From: Joel VanderWerf Date: 2009-08-13T07:05:21+09:00 Subject: Re: Class#descendants? Tony Arcieri wrote: > For what it's worth, here's my implementation, which doesn't use > ObjectSpace. It's a bit less trivial and I wonder if it could be made > better: > > http://gist.github.com/166800 > > Workarounds for ActiveSupport included, yay! Not all classes are constants... my_numbers = Class.new(Numeric) p Numeric.descendants a = [] ObjectSpace.each_object(Class) {|cl| a << cl if cl <= Numeric} p a -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407