class

Module

v2.3.8 - Show latest stable - Superclass: Object

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!"

Included modules

  • ActiveSupport::CoreExtensions::Module
  • ActiveSupport::Deprecation::ClassMethods

Files

  • activesupport/lib/active_support/core_ext/module.rb
  • 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/delegation.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/deprecation.rb