Class: Ea::Mdg::Loader
- Inherits:
-
Object
- Object
- Ea::Mdg::Loader
- Defined in:
- lib/ea/mdg/loader.rb
Overview
Parses an MDG technology file into an Mdg::Document.
Supports two EA MDG file formats:
1. **MDG.Technology format** (root: `<MDG.Technology>`) —
Parsed via lutaml-model XML mapping (Ea::Mdg::Xml::*).
Carries UMLProfile elements with Stereotype definitions
and their tagged-value specs. Example: CityGML MDG.
2. **XMI format** (root: `<XMI>`) — Delegates to the xmi
gem's typed Sparx model for UML class/attribute/generalization
extraction. Carries reference model classes. Example: ISO 19103.
The format is auto-detected from the root element. Both contribute to the same Document; stereotypes and classifiers coexist without coupling.
Instance Attribute Summary collapse
-
#xml ⇒ Object
readonly
Returns the value of attribute xml.
Class Method Summary collapse
Instance Method Summary collapse
- #document ⇒ Object
-
#initialize(xml) ⇒ Loader
constructor
A new instance of Loader.
Constructor Details
#initialize(xml) ⇒ Loader
Returns a new instance of Loader.
24 25 26 |
# File 'lib/ea/mdg/loader.rb', line 24 def initialize(xml) @xml = xml end |
Instance Attribute Details
#xml ⇒ Object (readonly)
Returns the value of attribute xml.
22 23 24 |
# File 'lib/ea/mdg/loader.rb', line 22 def xml @xml end |
Class Method Details
.from_path(path) ⇒ Object
28 29 30 |
# File 'lib/ea/mdg/loader.rb', line 28 def self.from_path(path) new(File.read(path)) end |
.from_xml(xml) ⇒ Object
32 33 34 |
# File 'lib/ea/mdg/loader.rb', line 32 def self.from_xml(xml) new(xml) end |
Instance Method Details
#document ⇒ Object
36 37 38 |
# File 'lib/ea/mdg/loader.rb', line 36 def document @document ||= build_document end |