Class: Suma::EengineConverter
- Inherits:
-
Object
- Object
- Suma::EengineConverter
- Defined in:
- lib/suma/eengine_converter.rb
Overview
Converts eengine comparison XML to Expressir::Changes::SchemaChange.
Pure converter: takes XML content as a string (no I/O). The caller is responsible for reading the file. This keeps the object cheap to construct and easy to test in isolation — no fixture file required just to instantiate.
Instance Method Summary collapse
-
#convert(version:, existing_change_schema: nil) ⇒ Expressir::Changes::SchemaChange
Convert the eengine XML to a ChangeSchema.
-
#initialize(schema_name, xml_content) ⇒ EengineConverter
constructor
A new instance of EengineConverter.
Constructor Details
#initialize(schema_name, xml_content) ⇒ EengineConverter
Returns a new instance of EengineConverter.
13 14 15 16 |
# File 'lib/suma/eengine_converter.rb', line 13 def initialize(schema_name, xml_content) @schema_name = schema_name @xml_content = xml_content end |
Instance Method Details
#convert(version:, existing_change_schema: nil) ⇒ Expressir::Changes::SchemaChange
Convert the eengine XML to a ChangeSchema.
24 25 26 27 28 29 30 31 |
# File 'lib/suma/eengine_converter.rb', line 24 def convert(version:, existing_change_schema: nil) Expressir::Commands::ChangesImportEengine.from_xml( @xml_content, @schema_name, version, existing_schema: existing_change_schema, ) end |