aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/active_support_core_extensions.textile
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-01-18 23:28:14 +0100
committerXavier Noria <fxn@hashref.com>2010-01-18 23:28:14 +0100
commitcf82ddc96a867e63edc60e5813070a8f7b58fc14 (patch)
tree58c27b1dbaecaf06f1ca0d689edc96fe405d3b68 /railties/guides/source/active_support_core_extensions.textile
parent9aee3659242766896d7d4727a7db425dcb86ded7 (diff)
downloadrails-cf82ddc96a867e63edc60e5813070a8f7b58fc14.tar.gz
rails-cf82ddc96a867e63edc60e5813070a8f7b58fc14.tar.bz2
rails-cf82ddc96a867e63edc60e5813070a8f7b58fc14.zip
AS guide: documents Object#extended_by
Diffstat (limited to 'railties/guides/source/active_support_core_extensions.textile')
-rw-r--r--railties/guides/source/active_support_core_extensions.textile25
1 files changed, 25 insertions, 0 deletions
diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile
index f8a72db703..b3c157208c 100644
--- a/railties/guides/source/active_support_core_extensions.textile
+++ b/railties/guides/source/active_support_core_extensions.textile
@@ -363,6 +363,31 @@ See also +Class#subclasses+ in "Extensions to +Class+ FIXME THIS LINK":FIXME.
NOTE: Defined in +active_support/core_ext/object/extending.rb+.
+h5. +extended_by+
+
+The method +extended_by+ returns an array with the modules that extend the receiver, if any:
+
+<ruby>
+module M
+end
+
+module N2
+end
+
+module N
+ include N2
+end
+
+class C
+ extend M
+ extend N
+end
+
+C.extended_by # => [N, N2, M]
+</ruby>
+
+NOTE: Defined in +active_support/core_ext/object/extending.rb+.
+
h4. Instance Variables
Active Support provides several methods to ease access to instance variables.