From 947cc874be3e652eb76af1808fcf2fa692f4ace6 Mon Sep 17 00:00:00 2001 From: Anton Kalyaev Date: Sat, 11 May 2013 13:17:34 +0400 Subject: added docs for InheritedOptions class [ci skip] --- activesupport/lib/active_support/ordered_options.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activesupport') 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) -- cgit v1.2.3