G
Giles Bowkett
Say I've got a class and I know it has subclasses. I'm absolutely sure
there must be an irb ObjectSpace one-liner to give me all the
subclasses of an arbitrary class.
The best I have right now is based on a solution to something else, a
Scriptaculous inline autocompleter for Rails apps that gives you Ajaxy
autocomplete search of all class names within your Rails app.
http://gilesbowkett.com/blog_code_samples/123006_seaside_rails/pat.txt
http://gilesbowkett.blogspot.com/search?q=cleverness
I've been able to find the Class instance method #inherited(), which
takes another class and tells you yay or nay, but a simple one-liner
to return a class's subclasses has so far proved out of my reach.
I know it exists. I just don't know what it is. I'm also kind of
stymied because it appears ObjectSpace has #each_object but not #each.
That seems so weird to me.
there must be an irb ObjectSpace one-liner to give me all the
subclasses of an arbitrary class.
The best I have right now is based on a solution to something else, a
Scriptaculous inline autocompleter for Rails apps that gives you Ajaxy
autocomplete search of all class names within your Rails app.
http://gilesbowkett.com/blog_code_samples/123006_seaside_rails/pat.txt
http://gilesbowkett.blogspot.com/search?q=cleverness
I've been able to find the Class instance method #inherited(), which
takes another class and tells you yay or nay, but a simple one-liner
to return a class's subclasses has so far proved out of my reach.
I know it exists. I just don't know what it is. I'm also kind of
stymied because it appears ObjectSpace has #each_object but not #each.
That seems so weird to me.