This module provides an internal implementation to track descendants which is faster than iterating through ObjectSpace.

Methods
C
D
I
Class Public methods
clear()
# File activesupport/lib/active_support/descendants_tracker.rb, line 18
def self.clear
  if defined? ActiveSupport::Dependencies
    @@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
  else
    @@direct_descendants.clear
  end
end
descendants(klass)
# File activesupport/lib/active_support/descendants_tracker.rb, line 11
def self.descendants(klass)
  @@direct_descendants[klass].inject([]) do |descendants, _klass|
    descendants << _klass
    descendants.concat _klass.descendants
  end
end
direct_descendants(klass)
# File activesupport/lib/active_support/descendants_tracker.rb, line 7
def self.direct_descendants(klass)
  @@direct_descendants[klass]
end
Instance Public methods
descendants()
# File activesupport/lib/active_support/descendants_tracker.rb, line 41
def descendants
  DescendantsTracker.descendants(self)
end
direct_descendants()
# File activesupport/lib/active_support/descendants_tracker.rb, line 37
def direct_descendants
  DescendantsTracker.direct_descendants(self)
end
inherited(base)
# File activesupport/lib/active_support/descendants_tracker.rb, line 32
def inherited(base)
  self.direct_descendants << base
  super
end