reevoo/sapience-rb

View on GitHub
lib/sapience/descendants.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true
module Sapience
  module Descendants
    def descendants # :nodoc:
      descendants = []
      ObjectSpace.each_object(singleton_class) do |k|
        descendants.unshift k unless k == self
      end
      descendants
    end
  end
end