diff options
author | Josep M. Bach <josep.m.bach@gmail.com> | 2010-08-14 17:01:11 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-08-15 02:22:37 +0200 |
commit | c7adc961868a8a0b83e70fc2be8c60013a20fa1b (patch) | |
tree | d2364e1425bc2b3afb42737d3abad361b928aa06 /activesupport/lib | |
parent | ca87d0a395c43eb95f0f744dd71b85cfb76e9545 (diff) | |
download | rails-c7adc961868a8a0b83e70fc2be8c60013a20fa1b.tar.gz rails-c7adc961868a8a0b83e70fc2be8c60013a20fa1b.tar.bz2 rails-c7adc961868a8a0b83e70fc2be8c60013a20fa1b.zip |
Documented active_support/configurable
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/configurable.rb | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/configurable.rb b/activesupport/lib/active_support/configurable.rb index a0c9c9e33a..5b85f9394a 100644 --- a/activesupport/lib/active_support/configurable.rb +++ b/activesupport/lib/active_support/configurable.rb @@ -4,6 +4,8 @@ require 'active_support/core_ext/kernel/singleton_class' require 'active_support/core_ext/module/delegation' module ActiveSupport + # Configurable provides a <tt>config</tt> method to store and retrieve + # configuration options as an <tt>OrderedHash</tt>. module Configurable extend ActiveSupport::Concern @@ -29,8 +31,25 @@ module ActiveSupport end end + # Reads and writes attributes from a configuration <tt>OrderedHash</tt>. + # + # require 'active_support/configurable' + # + # class User + # include ActiveSupport::Configurable + # 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 ||= ActiveSupport::InheritableOptions.new(self.class.config) end end -end
\ No newline at end of file +end + |