Skip to content
This repository
Browse code

AS guide: documents module attributes

  • Loading branch information...
commit b712d80085a819cad09377f023b935493d8933de 1 parent 466948e
Xavier Noria authored February 06, 2010
27  railties/guides/source/active_support_core_extensions.textile
Source Rendered
@@ -591,6 +591,33 @@ end
591 591
 
592 592
 NOTE: Defined in +active_support/core_ext/module/attr_internal.rb+.
593 593
 
  594
+h5. Module Attributes
  595
+
  596
+The macros +mattr_reader+, +mattr_writer+, and +mattr_accessor+ are analogous to the +cattr_*+ macros defined for class. Check "Class Attributes":#class-attributes.
  597
+
  598
+For example, the dependencies mechanism uses them:
  599
+
  600
+<ruby>
  601
+module ActiveSupport
  602
+  module Dependencies
  603
+    mattr_accessor :warnings_on_first_load
  604
+    mattr_accessor :history
  605
+    mattr_accessor :loaded
  606
+    mattr_accessor :mechanism
  607
+    mattr_accessor :load_paths
  608
+    mattr_accessor :load_once_paths
  609
+    mattr_accessor :autoloaded_constants
  610
+    mattr_accessor :explicitly_unloadable_constants
  611
+    mattr_accessor :logger
  612
+    mattr_accessor :log_activity
  613
+    mattr_accessor :constant_watch_stack
  614
+    mattr_accessor :constant_watch_stack_mutex
  615
+  end
  616
+end
  617
+</ruby>
  618
+
  619
+NOTE: Defined in +active_support/core_ext/module/attribute_accessors.rb+.
  620
+
594 621
 h4. Delegation
595 622
 
596 623
 The class method +delegate+

0 notes on commit b712d80

Please sign in to comment.
Something went wrong with that request. Please try again.