By default, only instances of Hash itself are
extractable. Subclasses of Hash may implement this
method and return true to declare themselves as extractable. If a Hash is extractable, Array#extract_options!
pops it from the Array when it is the last element
of the Array.

Called when object is nested under an object that receives with_indifferent_access.
This method will be called on the current object by the enclosing object
and is aliased to with_indifferent_access
by default. Subclasses of Hash may overwrite this
method to return self if converting to an
ActiveSupport::HashWithIndifferentAccess would not be
desirable.

To do so, the method loops over the pairs and builds nodes that depend on
the values. Given a pair key, value:

If value is a hash there's a recursive call with
key as :root.

If value is an array there's a recursive call with
key as :root, and key singularized
as :children.

If value is a callable object it must expect one or two
arguments. Depending on the arity, the callable is invoked with the
options hash as first argument with key as
:root, and key singularized as second argument.
The callable can add nodes by using options[:builder].

Otherwise, a node with key as tag is created with a string
representation of value as text node. If value is
nil an attribute “nil” set to “true” is added. Unless the
option :skip_types exists and is true, an attribute “type” is
added as well according to the following mapping:

By default the root node is “hash”, but that's configurable via the
:root option.

The default XML builder is a fresh instance of
Builder::XmlMarkup. You can configure your own builder with
the :builder option. The method also accepts options like
:dasherize and friends, they are forwarded to the builder.