diff options
author | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-05-28 02:18:35 -0500 |
---|---|---|
committer | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-05-28 02:18:44 -0500 |
commit | 0ad2146ccf45b3a26924e729a92cd2ff98356413 (patch) | |
tree | 6cec26789e48aae7746fa9b90f450aaf189f655c /activesupport | |
parent | ca65dcbbb2eca975782ea007a308000f1fbaf57f (diff) | |
download | rails-0ad2146ccf45b3a26924e729a92cd2ff98356413.tar.gz rails-0ad2146ccf45b3a26924e729a92cd2ff98356413.tar.bz2 rails-0ad2146ccf45b3a26924e729a92cd2ff98356413.zip |
remove :nodoc: from Class#subclasses [ci skip]
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/class/subclasses.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/core_ext/class/subclasses.rb b/activesupport/lib/active_support/core_ext/class/subclasses.rb index 74ea047c24..c2e0ebb3d4 100644 --- a/activesupport/lib/active_support/core_ext/class/subclasses.rb +++ b/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 @@ class Class #:nodoc: 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 @@ class Class #:nodoc: # 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| |