Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added docs for InheritedOptions class [ci skip]

  • Loading branch information...
commit 947cc874be3e652eb76af1808fcf2fa692f4ace6 1 parent 2976054
@akalyaev akalyaev authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 activesupport/lib/active_support/ordered_options.rb
View
8 activesupport/lib/active_support/ordered_options.rb
@@ -40,6 +40,14 @@ def respond_to_missing?(name, include_private)
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)
Please sign in to comment.
Something went wrong with that request. Please try again.