diff options
author | Anton Kalyaev <anton.kalyaev@gmail.com> | 2013-05-11 13:17:34 +0400 |
---|---|---|
committer | Anton Kalyaev <anton.kalyaev@gmail.com> | 2013-05-11 13:17:34 +0400 |
commit | 947cc874be3e652eb76af1808fcf2fa692f4ace6 (patch) | |
tree | ccd2c702910d45bce3aefe491b4508bd4198c942 | |
parent | 2976054f17fbd35545b1657915870aafa10e3c0b (diff) | |
download | rails-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.rb | 8 |
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) |