class ActiveSupport::DescendantsTracker::DescendantsArray

:nodoc:
DescendantsArray is an array that contains weak references to classes.

def <<(klass)

def <<(klass)
  @refs << WeakRef.new(klass)
end

def cleanup!

def cleanup!
  @refs.delete_if { |ref| !ref.weakref_alive? }
end

def each

def each
  @refs.reject! do |ref|
    yield ref.__getobj__
    false
  rescue WeakRef::RefError
    true
  end
  self
end

def initialize

def initialize
  @refs = []
end

def initialize_copy(orig)

def initialize_copy(orig)
  @refs = @refs.dup
end

def refs_size

def refs_size
  @refs.size
end

def reject!

def reject!
  @refs.reject! do |ref|
    yield ref.__getobj__
  rescue WeakRef::RefError
    true
  end
end