aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/module/attribute_accessors.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/module/attribute_accessors.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb b/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb
index 58ff363244..51e1c9af90 100644
--- a/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb
+++ b/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb
@@ -1,6 +1,16 @@
# Extends the module object with module and instance accessors for class attributes,
# just like the native attr* accessors for instance attributes.
-class Module # :nodoc:
+#
+# module AppConfiguration
+# mattr_accessor :google_api_key
+# self.google_api_key = "123456789"
+#
+# mattr_accessor :paypal_url
+# self.paypal_url = "www.sandbox.paypal.com"
+# end
+#
+# AppConfiguration.google_api_key = "overriding the api key!"
+class Module
def mattr_reader(*syms)
syms.each do |sym|
next if sym.is_a?(Hash)