holywyvern/carbuncle

View on GitHub
gems/carbuncle-support/mrblib/descendants.rb

Summary

Maintainability
A
25 mins
Test Coverage
class Class
  def descendants
    descendants = []
    ObjectSpace.each_object(singleton_class) do |k|
      next if k.singleton_class?

      descendants.unshift k unless k == self
    end
    descendants
  end
end