This module provides an internal implementation to track descendants which is faster than iterating through ObjectSpace.
# File D:/Develope/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/descendants_tracker.rb, line 20 def self.clear @@direct_descendants.each do |klass, descendants| if ActiveSupport::Dependencies.autoloaded?(klass) @@direct_descendants.delete(klass) else descendants.reject! { |v| ActiveSupport::Dependencies.autoloaded?(v) } end end end
# File D:/Develope/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/descendants_tracker.rb, line 13 def self.descendants(klass) @@direct_descendants[klass].inject([]) do |descendants, _klass| descendants << _klass descendants.concat _klass.descendants end end
# File D:/Develope/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/descendants_tracker.rb, line 39 def descendants DescendantsTracker.descendants(self) end
Generated with the Darkfish Rdoc Generator 2.