Merge pull request #4302 from lest/simplify-descendants

simplify Class#descendants using singleton_class method
This commit is contained in:
Xavier Noria 2012-01-04 10:59:38 -08:00
commit 33386b065c

@ -7,7 +7,7 @@ class Class #:nodoc:
def descendants
descendants = []
ObjectSpace.each_object(class << self; self; end) do |k|
ObjectSpace.each_object(singleton_class) do |k|
descendants.unshift k unless k == self
end
descendants