class

Module

v2.1.0 - 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::Deprecation::ClassMethods

Files

  • activesupport/lib/active_support/core_ext/module/aliasing.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/introspection.rb
  • activesupport/lib/active_support/core_ext/module/loading.rb
  • activesupport/lib/active_support/dependencies.rb
  • activesupport/lib/active_support/deprecation.rb
  • railties/lib/console_with_helpers.rb