class
ActiveSupport::InheritableOptions
v7.1.3.4 -
Show latest stable
- Superclass: OrderedOptions
Inheritable Options
InheritableOptions provides a constructor to build an OrderedOptions hash inherited from 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'
If the existing hash has string keys, call Hash#symbolize_keys on it.
h = ActiveSupport::InheritableOptions.new({ 'girl' => 'Mary', 'boy' => 'John' }.symbolize_keys) h.girl # => 'Mary' h.boy # => 'John'
Files
- activesupport/lib/active_support/ordered_options.rb