diff options
author | Xavier Noria <fxn@hashref.com> | 2010-02-06 18:17:08 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-02-06 18:17:08 +0100 |
commit | b712d80085a819cad09377f023b935493d8933de (patch) | |
tree | cdd7cdaa08cc877e660f82b5a21680a6db601876 /railties | |
parent | 466948e64b2b7a86297b02b00289d69413e781f1 (diff) | |
download | rails-b712d80085a819cad09377f023b935493d8933de.tar.gz rails-b712d80085a819cad09377f023b935493d8933de.tar.bz2 rails-b712d80085a819cad09377f023b935493d8933de.zip |
AS guide: documents module attributes
Diffstat (limited to 'railties')
-rw-r--r-- | railties/guides/source/active_support_core_extensions.textile | 27 |
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+ |