Class: Expressir::Eengine::CompareReport

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/expressir/eengine/compare_report.rb

Overview

Represents an Eengine comparison XML report Supports three modes: ARM, MIM, and Schema

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_file(path) ⇒ CompareReport

Load a CompareReport from an XML file

Parameters:

  • path (String)

    Path to the XML file

Returns:



53
54
55
# File 'lib/expressir/eengine/compare_report.rb', line 53

def from_file(path)
  from_xml(File.read(path))
end

.from_xml(xml_content) ⇒ CompareReport, ...

Parse XML and return appropriate report class based on mode

Parameters:

  • xml_content (String)

    XML content

Returns:



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/expressir/eengine/compare_report.rb', line 36

def from_xml(xml_content)
  mode = detect_mode(xml_content)

  case mode
  when "arm"
    ArmCompareReport.from_xml(xml_content)
  when "mim"
    MimCompareReport.from_xml(xml_content)
  else
    super
  end
end

Instance Method Details

#modeString

Detect XML mode from the report

Returns:

  • (String)

    “arm”, “mim”, or “schema”



76
77
78
# File 'lib/expressir/eengine/compare_report.rb', line 76

def mode
  "schema"
end