Class: Lutaml::XMI::Parsers::XML
- Inherits:
-
Object
- Object
- Lutaml::XMI::Parsers::XML
- Defined in:
- lib/lutaml/xmi/parsers/xml.rb
Overview
Class for parsing .xmi schema files into ::Lutaml::Uml::Document
Constant Summary collapse
- LOWER_VALUE_MAPPINGS =
{ "0" => "C", "1" => "M", }.freeze
Instance Attribute Summary collapse
-
#xmi_cache ⇒ Object
readonly
Returns the value of attribute xmi_cache.
-
#xmi_root_model ⇒ Object
readonly
Returns the value of attribute xmi_root_model.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#xmi_cache ⇒ Object (readonly)
Returns the value of attribute xmi_cache.
17 18 19 |
# File 'lib/lutaml/xmi/parsers/xml.rb', line 17 def xmi_cache @xmi_cache end |
#xmi_root_model ⇒ Object (readonly)
Returns the value of attribute xmi_root_model.
17 18 19 |
# File 'lib/lutaml/xmi/parsers/xml.rb', line 17 def xmi_root_model @xmi_root_model end |
Class Method Details
.parse(xml, _options = {}) ⇒ Lutaml::Uml::Document
22 23 24 25 26 |
# File 'lib/lutaml/xmi/parsers/xml.rb', line 22 def self.parse(xml, = {}) xml_content = File.read(xml) xmi_model = Xmi::Sparx::SparxRoot2013.from_xml(xml_content) new.parse(xmi_model) end |
Instance Method Details
#parse(xmi_model) ⇒ Lutaml::Uml::Document
30 31 32 33 34 |
# File 'lib/lutaml/xmi/parsers/xml.rb', line 30 def parse(xmi_model) @xmi_cache = {} @xmi_root_model = xmi_model ::Lutaml::Uml::Document.new(serialize_to_hash(xmi_model)) end |