From 3e94032227d450d479f511070c51f37f53d0ecc4 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 17 Jan 2010 00:53:47 +0100 Subject: AS guide: documents Class#descendents --- .../guides/source/active_support_core_extensions.textile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index 0289121f35..f8a72db703 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -627,7 +627,17 @@ 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. Subclasses +h4. Descendants + +h5. +descendents+ + +The +descendents+ method returns all the descendants of its receiver as an array of class objects. This method performs no filtering so non-reachable classes are included, if any. + +See aso +Object#subclasses_of+, explained in "Extensions to All Objects FIX THIS LINK":FIXME. + +NOTE: Defined in +active_support/core_ext/object/extending.rb+. + +h5. +subclasses+ The +subclasses+ method returns the names of all the anonymous or reachable descendants of its receiver as an array of strings: @@ -650,7 +660,7 @@ end M::A.subclasses # => ["N::C", "M::B2", "M::B1"] -WARNING: +ActiveRecord::Base+ redefines this method, it returns class objects, reachable or not, and it is protected. +WARNING: +ActiveRecord::Base+ redefines +subclasses+, it returns class objects, reachable or not, and it is protected. See aso +Object#subclasses_of+, explained in "Extensions to All Objects FIX THIS LINK":FIXME. -- cgit v1.2.3