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



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

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

.get_profile_options(profile) ⇒ Object

Delegate to XmlResolver



153
154
155
# File 'lib/canon/comparison/match_options.rb', line 153

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



160
161
162
# File 'lib/canon/comparison/match_options.rb', line 160

def match_dimensions
  MatchOptions::XmlResolver.match_dimensions
end

.resolve(**kwargs) ⇒ Object

Delegate to XmlResolver



148
149
150
# File 'lib/canon/comparison/match_options.rb', line 148

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