From b712d80085a819cad09377f023b935493d8933de Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 6 Feb 2010 18:17:08 +0100 Subject: [PATCH] AS guide: documents module attributes --- .../active_support_core_extensions.textile | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index fa0e2339cadee..a62a99800b2b2 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: + + +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 + + +NOTE: Defined in +active_support/core_ext/module/attribute_accessors.rb+. + h4. Delegation The class method +delegate+