From: ara.t.howard@... Date: 2006-02-16T00:38:09+09:00 Subject: Re: which class defined On Wed, 15 Feb 2006, raving_ruby_rider wrote: > Is there a way to know about what > classes were defined by loading a script? see dynaload http://rubyforge.org/frs/?group_id=1024&release_id=3786 http://codeforpeople.com/lib/ruby/dynaload/dynaload-0.0.0/README is use it for the very same. > If not, can the Ruby system be asked for a collection of subclasses for a > particular Class? harp:~ > cat a.rb class C class << self def children() @children ||= [] end def inherited(other) children << other and super end def descendants() children.inject([]){|d,c| d.push(c, *c.descendants)} end end end load "b.rb" p C::children p C::descendants p B::children p B::descendants harp:~ > cat b.rb class B < C; end class D < B; end harp:~ > ruby a.rb [B] [B, D] [D] [D] regards. -a -- judge your success by what you had to give up in order to get it. - h.h. the 14th dali lama