Module: Canon::Comparison::XmlComparatorHelpers::NodeTypeComparator

Defined in:
lib/canon/comparison/xml_comparator/node_type_comparator.rb

Overview

Node type comparison strategy for XML nodes

Handles dispatching comparison logic based on node type. Supports both Canon::Xml::Node (with symbolic node_type) and backend nodes (Nokogiri/Moxml) via XmlParsing type checks.

Class Method Summary collapse

Class Method Details

.compare(node1, node2, comparator, opts, child_opts, diff_children, differences) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/canon/comparison/xml_comparator/node_type_comparator.rb', line 13

def compare(node1, node2, comparator, opts, child_opts,
diff_children, differences)
  if node1.is_a?(Canon::Xml::Node) && node2.is_a?(Canon::Xml::Node)
    compare_by_symbolic_type(node1, node2, comparator, opts, child_opts,
                             diff_children, differences)
  else
    compare_by_backend_type(node1, node2, comparator, opts, child_opts,
                            diff_children, differences)
  end
end