Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 0ad2146ccf45b3a26924e729a92cd2ff98356413 1 parent ca65dcb
Francesco Rodriguez authored
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,11 +1,11 @@
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
@@ -13,7 +13,7 @@ def descendants
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|
Please sign in to comment.
Something went wrong with that request. Please try again.