aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/active_support_core_extensions.textile
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-02-06 18:17:08 +0100
committerXavier Noria <fxn@hashref.com>2010-02-06 18:17:08 +0100
commitb712d80085a819cad09377f023b935493d8933de (patch)
treecdd7cdaa08cc877e660f82b5a21680a6db601876 /railties/guides/source/active_support_core_extensions.textile
parent466948e64b2b7a86297b02b00289d69413e781f1 (diff)
downloadrails-b712d80085a819cad09377f023b935493d8933de.tar.gz
rails-b712d80085a819cad09377f023b935493d8933de.tar.bz2
rails-b712d80085a819cad09377f023b935493d8933de.zip
AS guide: documents module attributes
Diffstat (limited to 'railties/guides/source/active_support_core_extensions.textile')
-rw-r--r--railties/guides/source/active_support_core_extensions.textile27
1 files changed, 27 insertions, 0 deletions
diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile
index fa0e2339ca..a62a99800b 100644
--- a/railties/guides/source/active_support_core_extensions.textile
+++ b/railties/guides/source/active_support_core_extensions.textile
@@ -591,6 +591,33 @@ end
NOTE: Defined in +active_support/core_ext/module/attr_internal.rb+.
+h5. Module Attributes
+
+The macros +mattr_reader+, +mattr_writer+, and +mattr_accessor+ are analogous to the +cattr_*+ macros defined for class. Check "Class Attributes":#class-attributes.
+
+For example, the dependencies mechanism uses them:
+
+<ruby>
+module ActiveSupport
+ module Dependencies
+ mattr_accessor :warnings_on_first_load
+ mattr_accessor :history
+ mattr_accessor :loaded
+ mattr_accessor :mechanism
+ mattr_accessor :load_paths
+ mattr_accessor :load_once_paths
+ mattr_accessor :autoloaded_constants
+ mattr_accessor :explicitly_unloadable_constants
+ mattr_accessor :logger
+ mattr_accessor :log_activity
+ mattr_accessor :constant_watch_stack
+ mattr_accessor :constant_watch_stack_mutex
+ end
+end
+</ruby>
+
+NOTE: Defined in +active_support/core_ext/module/attribute_accessors.rb+.
+
h4. Delegation
The class method +delegate+