Extends the module object with module and instance accessors for class
attributes, just like the native attr* accessors for instance attributes.
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!"
Show files where this class is defined (10 files)
activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb
activesupport/lib/active_support/core_ext/module/attr_internal.rb
activesupport/lib/active_support/core_ext/module/attribute_accessors.rb
activesupport/lib/active_support/core_ext/module/inclusion.rb
activesupport/lib/active_support/core_ext/module/loading.rb
activesupport/lib/active_support/core_ext/module/synchronization.rb
activesupport/lib/active_support/core_ext/module/delegation.rb
activesupport/lib/active_support/core_ext/module.rb
activesupport/lib/active_support/deprecation.rb
railties/lib/console_with_helpers.rb