Module: Canon::Comparison::MatchOptions::Xml

Defined in:
lib/canon/comparison/match_options.rb

Overview

XML/HTML-specific matching options

Constant Summary collapse

MATCH_DIMENSIONS =

Matching dimensions for XML/HTML (collectively exhaustive)

%i[
  text_content
  structural_whitespace
  attribute_presence
  attribute_order
  attribute_values
  element_position
  comments
].freeze
FORMAT_DEFAULTS =

Expose FORMAT_DEFAULTS from XmlResolver (for backward compatibility)

MatchOptions::XmlResolver.const_get(:FORMAT_DEFAULTS)
MATCH_PROFILES =

Expose MATCH_PROFILES from XmlResolver (for backward compatibility)

MatchOptions::XmlResolver.const_get(:MATCH_PROFILES)

Class Method Summary collapse

Class Method Details

.format_defaults(format) ⇒ Hash

Get format-specific default options

Parameters:

  • format (Symbol)

    Format type

Returns:

  • (Hash)

    Default options for the format



189
190
191
# File 'lib/canon/comparison/match_options.rb', line 189

def format_defaults(format)
  MatchOptions::XmlResolver.format_defaults(format)
end

.get_profile_options(profile) ⇒ Object

Delegate to XmlResolver



174
175
176
# File 'lib/canon/comparison/match_options.rb', line 174

def get_profile_options(profile)
  MatchOptions::XmlResolver.get_profile_options(profile)
end

.match_dimensionsArray<Symbol>

Get valid match dimensions for XML/HTML

Returns:

  • (Array<Symbol>)

    Valid dimensions



181
182
183
# File 'lib/canon/comparison/match_options.rb', line 181

def match_dimensions
  MatchOptions::XmlResolver.match_dimensions
end

.resolve(**kwargs) ⇒ Object

Delegate to XmlResolver



169
170
171
# File 'lib/canon/comparison/match_options.rb', line 169

def resolve(**kwargs)
  MatchOptions::XmlResolver.resolve(**kwargs)
end