Class: Suma::EengineConverter
- Inherits:
-
Object
- Object
- Suma::EengineConverter
- Defined in:
- lib/suma/eengine_converter.rb
Overview
Converts eengine comparison XML to Expressir::Changes::SchemaChange This is a thin wrapper around Expressir’s ChangesImportEengine command
Instance Method Summary collapse
-
#convert(version:, existing_change_schema: nil) ⇒ Expressir::Changes::SchemaChange
Convert the eengine XML to a ChangeSchema.
-
#initialize(xml_path, schema_name) ⇒ EengineConverter
constructor
A new instance of EengineConverter.
Constructor Details
#initialize(xml_path, schema_name) ⇒ EengineConverter
Returns a new instance of EengineConverter.
9 10 11 12 13 |
# File 'lib/suma/eengine_converter.rb', line 9 def initialize(xml_path, schema_name) @xml_path = xml_path @schema_name = schema_name @xml_content = File.read(xml_path) end |
Instance Method Details
#convert(version:, existing_change_schema: nil) ⇒ Expressir::Changes::SchemaChange
Convert the eengine XML to a ChangeSchema
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/suma/eengine_converter.rb', line 21 def convert(version:, existing_change_schema: nil) # Use Expressir's built-in conversion which properly handles # HTML elements in descriptions Expressir::Commands::ChangesImportEengine.from_xml( @xml_content, @schema_name, version, existing_schema: existing_change_schema, ) end |