Class: Lutaml::Qea::Parser
- Inherits:
-
Object
- Object
- Lutaml::Qea::Parser
- Defined in:
- lib/lutaml/qea/parser.rb
Overview
Parser class provides backward compatibility wrapper for Qea.parse
This class exists for compatibility with older code that uses Qea::Parser.parse instead of the newer Qea.parse method.
For validation use cases, this returns both database and document. For simple parsing, use Qea.parse directly which returns just document.
Class Method Summary collapse
-
.parse(qea_path, options = {}) ⇒ Lutaml::Uml::Document
Parse a QEA file and return document only.
Instance Method Summary collapse
-
#parse(qea_path, options = {}) ⇒ Hash
Instance method for compatibility with test expectations.
Class Method Details
.parse(qea_path, options = {}) ⇒ Lutaml::Uml::Document
Parse a QEA file and return document only
This is a backward compatibility wrapper that delegates to Qea.parse
34 35 36 |
# File 'lib/lutaml/qea/parser.rb', line 34 def parse(qea_path, = {}) Qea.parse(qea_path, ) end |
Instance Method Details
#parse(qea_path, options = {}) ⇒ Hash
Instance method for compatibility with test expectations
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/lutaml/qea/parser.rb', line 43 def parse(qea_path, = {}) # rubocop:disable Metrics/MethodLength # Load database config = [:config] loader = Services::DatabaseLoader.new(qea_path, config) database = loader.load # Create document factory = Factory::EaToUmlFactory.new(database, ) document = factory.create_document # Return both for validation support { database: database, document: document, } end |