lib/xml/mapping_extensions.rb
# Creates mapping nodes based on the fallback for all attributes for which a
# mapping node is present in the fallback but not in the primary.
# @param mapping_nodes [Hash[Symbol, Node]] The primary nodes
# @param mapping [Symbol] The primary mapping
# @param fallback [Symbol] The fallback mapping
Creates mapping nodes based on the fallback for all attributes for which a
mapping node is present in the fallback but not in the primary.
Creates mapping nodes based on the fallback for all attributes for which a mapping node is present in the fallback but not in the primary .
def add_fallback_nodes(mapping_nodes, mapping, fallback)
        all_nodes = nodes_by_attrname(fallback).map do |attrname, fallback_node|
          [attrname, clone_node(fallback_node, mapping)]
        end.to_h
        all_nodes.merge!(mapping_nodes)
      end
def add_fallback_nodes ( mapping_nodes , mapping , fallback ) all_nodes = nodes_by_attrname ( fallback ) . map do | attrname , fallback_node | [ attrname , clone_node ( fallback_node , mapping ) ] end . to_h all_nodes . merge! ( mapping_nodes ) end
Creates mapping nodes based on the fallback for all attributes for which a
mapping node is present in the fallback but not in the primary.
Creates mapping nodes based on the fallback for all attributes for which a mapping node is present in the fallback but not in the primary .
mapping_nodes
] The primary nodes
] The primary nodes
mapping
The primary mapping
The primary mapping
fallback
The fallback mapping
The fallback mapping