http://www.ruby-doc.org/core-1.9.3/Class.html#method-i-inherited could help to collect subclasses automatically.