aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/active_support_core_extensions.textile
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-07-08 16:53:37 +0200
committerXavier Noria <fxn@hashref.com>2010-07-08 16:53:37 +0200
commita9587935dec6b5de01d51553ecc6d4157a8ec173 (patch)
tree521fa7e0516924e3d762234180514788f15a178d /railties/guides/source/active_support_core_extensions.textile
parent4a1207d54077348b67fad95ffde5710cf0be31bd (diff)
downloadrails-a9587935dec6b5de01d51553ecc6d4157a8ec173.tar.gz
rails-a9587935dec6b5de01d51553ecc6d4157a8ec173.tar.bz2
rails-a9587935dec6b5de01d51553ecc6d4157a8ec173.zip
copy-edits some docs
Diffstat (limited to 'railties/guides/source/active_support_core_extensions.textile')
-rw-r--r--railties/guides/source/active_support_core_extensions.textile36
1 files changed, 20 insertions, 16 deletions
diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile
index de0c00ac68..58824d7aeb 100644
--- a/railties/guides/source/active_support_core_extensions.textile
+++ b/railties/guides/source/active_support_core_extensions.textile
@@ -1107,47 +1107,51 @@ If for whatever reason an application loads the definition of a mailer class and
NOTE: Defined in +active_support/core_ext/class/delegating_attributes.rb+.
-h4. Descendants & Subclasses
+h4. Subclasses & Descendants
-h5. +descendants+
+h5. +subclasses+
-The +descendants+ method returns all classes, including its children, that inherits from self.
+The +subclasses+ method returns the subclasses of the receiver:
<ruby>
class C; end
-C.descendants #=> []
+C.subclasses # => []
class B < C; end
-C.descendants #=> [B]
+C.subclasses # => [B]
class A < B; end
-C.descendants #=> [B, A]
+C.subclasses # => [B]
class D < C; end
-C.descendants #=> [B, A, D]
+C.subclasses # => [B, D]
</ruby>
-h5. +subclasses+
+The order in which these classes are returned is unspecified.
-The +subclasses+ method returns all direct classes that inherits from self.
+WARNING: This method is redefined in some Rails core classes but should be all compatible in Rails 3.1.
+
+NOTE: Defined in +active_support/core_ext/class/subclasses.rb+.
+
+h5. +descendants+
+
+The +descendants+ method returns all classes that are <tt>&lt;</tt> than its receiver:
<ruby>
class C; end
-C.subclasses #=> []
+C.descendants # => []
class B < C; end
-C.subclasses #=> [B]
+C.descendants # => [B]
class A < B; end
-C.subclasses #=> [B]
+C.descendants # => [B, A]
class D < C; end
-C.subclasses #=> [B, D]
+C.descendants # => [B, A, D]
</ruby>
-The order in which these class are returned is unspecified.
-
-WARNING: This method is redefined in some Rails core classes but should be all compatible in Rails 3.1.
+The order in which these classes are returned is unspecified.
NOTE: Defined in +active_support/core_ext/class/subclasses.rb+.