aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Kalyaev <anton.kalyaev@gmail.com>2013-05-11 13:17:34 +0400
committerAnton Kalyaev <anton.kalyaev@gmail.com>2013-05-11 13:17:34 +0400
commit947cc874be3e652eb76af1808fcf2fa692f4ace6 (patch)
treeccd2c702910d45bce3aefe491b4508bd4198c942
parent2976054f17fbd35545b1657915870aafa10e3c0b (diff)
downloadrails-947cc874be3e652eb76af1808fcf2fa692f4ace6.tar.gz
rails-947cc874be3e652eb76af1808fcf2fa692f4ace6.tar.bz2
rails-947cc874be3e652eb76af1808fcf2fa692f4ace6.zip
added docs for InheritedOptions class [ci skip]
-rw-r--r--activesupport/lib/active_support/ordered_options.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/ordered_options.rb b/activesupport/lib/active_support/ordered_options.rb
index c9518bda79..e03bb4ca0f 100644
--- a/activesupport/lib/active_support/ordered_options.rb
+++ b/activesupport/lib/active_support/ordered_options.rb
@@ -40,6 +40,14 @@ module ActiveSupport
end
end
+ # +InheritableOptions+ provides a constructor to build an +OrderedOptions+
+ # hash inherited from the another hash.
+ #
+ # Use this if you already have some hash and you want to create a new one based on it.
+ #
+ # h = ActiveSupport::InheritableOptions.new({ girl: 'Mary', boy: 'John' })
+ # h.girl # => 'Mary'
+ # h.boy # => 'John'
class InheritableOptions < OrderedOptions
def initialize(parent = nil)
if parent.kind_of?(OrderedOptions)