Class: Ea::Sources::Xmi::Adapter
- Inherits:
-
Object
- Object
- Ea::Sources::Xmi::Adapter
- Defined in:
- lib/ea/sources/xmi/adapter.rb
Overview
Driving port: produces an Ea::Model::Document from a parsed Xmi::Sparx::Root. Walks the UML model tree once and delegates to per-domain builders. The result is structurally identical to what the QEA adapter produces for the same conceptual source — that's the "single way" promise.
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
-
#xmi_path ⇒ Object
readonly
Returns the value of attribute xmi_path.
Class Method Summary collapse
-
.from_path(xmi_path) ⇒ Object
Convenience: build a document directly from an .xmi file path.
Instance Method Summary collapse
-
#initialize(root, xmi_path = nil) ⇒ Adapter
constructor
A new instance of Adapter.
- #to_document ⇒ Object
Constructor Details
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
12 13 14 |
# File 'lib/ea/sources/xmi/adapter.rb', line 12 def root @root end |
#xmi_path ⇒ Object (readonly)
Returns the value of attribute xmi_path.
12 13 14 |
# File 'lib/ea/sources/xmi/adapter.rb', line 12 def xmi_path @xmi_path end |
Class Method Details
.from_path(xmi_path) ⇒ Object
Convenience: build a document directly from an .xmi file path. Parses via Xmi::Sparx::Root.parse_xml.
21 22 23 24 25 |
# File 'lib/ea/sources/xmi/adapter.rb', line 21 def self.from_path(xmi_path) require "xmi" root = ::Xmi::Sparx::Root.parse_xml(File.read(xmi_path)) new(root, xmi_path).to_document end |