Module: Ea::Bridge::XmiToUml

Defined in:
lib/ea/bridge/xmi_to_uml.rb

Overview

Transforms an Xmi::Sparx::Root (the xmi gem's typed Sparx XMI model) into a Lutaml::Uml::Document.

This is the bridge between ea's internal XMI representation (the xmi gem's model tree) and the tool-agnostic UML metamodel from lutaml-uml.

The heavy lifting is done by the existing parser code in Ea::Xmi::Parser. This module is the clean public entry point — consumers should call Ea::Bridge::XmiToUml.transform(root) rather than reaching into the parser internals.

Class Method Summary collapse

Class Method Details

.require_lutaml_uml!Object



26
27
28
29
30
31
32
# File 'lib/ea/bridge/xmi_to_uml.rb', line 26

def require_lutaml_uml!
  require "lutaml/uml"
rescue LoadError => e
  raise Ea::Error,
        "Ea::Bridge requires the `lutaml-uml` gem. " \
        "Install it via `gem install lutaml-uml`. (#{e.message})"
end

.transform(xmi_root) ⇒ Lutaml::Uml::Document

Parameters:

  • xmi_root (Xmi::Sparx::Root)

    parsed xmi gem model

Returns:

  • (Lutaml::Uml::Document)


21
22
23
24
# File 'lib/ea/bridge/xmi_to_uml.rb', line 21

def transform(xmi_root)
  require_lutaml_uml!
  Ea::Xmi::Parser.new.parse(xmi_root)
end