From 9b96de6f3dfa31695c2fc27919e2989a98f6899d Mon Sep 17 00:00:00 2001 From: suchasurge Date: Sun, 6 Mar 2011 10:26:24 +0100 Subject: Some style changes --- activesupport/lib/active_support/configurable.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activesupport/lib/active_support/configurable.rb') diff --git a/activesupport/lib/active_support/configurable.rb b/activesupport/lib/active_support/configurable.rb index be19189c04..7bac3dbc91 100644 --- a/activesupport/lib/active_support/configurable.rb +++ b/activesupport/lib/active_support/configurable.rb @@ -41,6 +41,9 @@ module ActiveSupport # Allows you to add shortcut so that you don't have to refer to attribute through config. # Also look at the example for config to contrast. # + # + # ==== Example + # # class User # include ActiveSupport::Configurable # config_accessor :allowed_access @@ -65,6 +68,9 @@ module ActiveSupport # Reads and writes attributes from a configuration OrderedHash. # + # + # ==== Example + # # require 'active_support/configurable' # # class User -- cgit v1.2.3 From 6ce844a3c1d9c1de4ae54cbe73e0dbd0acbe688a Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 6 Mar 2011 17:49:39 +0100 Subject: removes Examples headers introduced in 9b96de6 Example headers are discouraged in the API guidelines. Code just flows with the text. They may be good in places where there's a lot of stuff and structure may add clarity --- activesupport/lib/active_support/configurable.rb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'activesupport/lib/active_support/configurable.rb') diff --git a/activesupport/lib/active_support/configurable.rb b/activesupport/lib/active_support/configurable.rb index 7bac3dbc91..8c56a21ef7 100644 --- a/activesupport/lib/active_support/configurable.rb +++ b/activesupport/lib/active_support/configurable.rb @@ -41,9 +41,6 @@ module ActiveSupport # Allows you to add shortcut so that you don't have to refer to attribute through config. # Also look at the example for config to contrast. # - # - # ==== Example - # # class User # include ActiveSupport::Configurable # config_accessor :allowed_access @@ -67,24 +64,21 @@ module ActiveSupport end # Reads and writes attributes from a configuration OrderedHash. - # # - # ==== Example + # require 'active_support/configurable' # - # require 'active_support/configurable' - # # class User # include ActiveSupport::Configurable - # end + # end # # user = User.new - # + # # user.config.allowed_access = true # user.config.level = 1 # # user.config.allowed_access # => true # user.config.level # => 1 - # + # def config @_config ||= self.class.config.inheritable_copy end -- cgit v1.2.3