lib/xml/mapping_extensions.rb
# Configures one mapping as a fallback for another, allowing mappings
# that differ e.g. from the default only in some small detail. 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, and
# likewise sets the root element name for the primary to the root element
# name for the fallback if it has not already been set.
#
# @param mapping [Symbol] the primary mapping
# @param fallback [Symbol] the fallback mapping to be used if the primary
#   mapping lacks a mapping node or root element name
Configures one mapping as a fallback for another, allowing mappings
that differ e.g. from the default only in some small detail. 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, and
likewise sets the root element name for the primary to the root element
name for the fallback if it has not already been set.
Configures one mapping as a fallback for another allowing mappings that differ e . g . from the default only in some small detail . 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 and likewise sets the root element name for the primary to the root element name for the fallback if it has not already been set .
def fallback_mapping(mapping, fallback)
        mapping_nodes = add_fallback_nodes(nodes_by_attrname(mapping), mapping, fallback)
        xml_mapping_nodes_hash[mapping] = mapping_nodes.values
        return if root_element_names[mapping]
        fallback_name = root_element_names[fallback]
        root_element_name(fallback_name, mapping: mapping)
      end
def fallback_mapping ( mapping , fallback ) mapping_nodes = add_fallback_nodes ( nodes_by_attrname ( mapping ) , mapping , fallback ) xml_mapping_nodes_hash [ mapping ] = mapping_nodes . values return if root_element_names [ mapping ] fallback_name = root_element_names [ fallback ] root_element_name ( fallback_name , mapping : mapping ) end
Configures one mapping as a fallback for another, allowing mappings
that differ e.g.
Configures one mapping as a fallback for another allowing mappings that differ e . g .
mapping
the primary mapping
the primary mapping
fallback
the fallback mapping to be used if the primary mapping lacks a mapping node or root element name
the fallback mapping to be used if the primary mapping lacks a mapping node or root element name