Skip to content
Browse files

remove :nodoc: from Class#subclasses [ci skip]

  • Loading branch information...
1 parent ca65dcb commit 0ad2146ccf45b3a26924e729a92cd2ff98356413 Francesco Rodriguez committed May 28, 2012
Showing with 10 additions and 4 deletions.
  1. +10 −4 activesupport/lib/active_support/core_ext/class/subclasses.rb
View
14 activesupport/lib/active_support/core_ext/class/subclasses.rb
@@ -1,19 +1,19 @@
require 'active_support/core_ext/module/anonymous'
require 'active_support/core_ext/module/reachable'
-class Class #:nodoc:
+class Class
begin
ObjectSpace.each_object(Class.new) {}
- def descendants
+ def descendants # :nodoc:
descendants = []
ObjectSpace.each_object(singleton_class) do |k|
descendants.unshift k unless k == self
end
descendants
end
rescue StandardError # JRuby
- def descendants
+ def descendants # :nodoc:
descendants = []
ObjectSpace.each_object(Class) do |k|
descendants.unshift k if k < self
@@ -25,7 +25,13 @@ def descendants
# Returns an array with the direct children of +self+.
#
- # Integer.subclasses # => [Bignum, Fixnum]
+ # Integer.subclasses # => [Fixnum, Bignum]
+ #
+ # class Foo; end
+ # class Bar < Foo; end
+ # class Baz < Foo; end
+ #
+ # Foo.subclasses # => [Baz, Bar]
def subclasses
subclasses, chain = [], descendants
chain.each do |k|

0 comments on commit 0ad2146

Please sign in to comment.
Something went wrong with that request. Please try again.