Class: Xmi::Sparx::Root
- Inherits:
-
Root
- Object
- Lutaml::Model::Serializable
- Root
- Xmi::Sparx::Root
- Defined in:
- lib/xmi/sparx/root.rb
Class Method Summary collapse
-
.parse_xml(xml_content) ⇒ Root
Parse XMI content into Ruby objects.
Instance Method Summary collapse
-
#build_index ⇒ Sparx::Index
Build index for fast lookups.
-
#index ⇒ Sparx::Index
Access the index (builds on first access if needed).
Methods included from XmiIdentity::Attributes
Methods inherited from Lutaml::Model::Serializable
Class Method Details
.parse_xml(xml_content) ⇒ Root
Parse XMI content into Ruby objects.
Uses the ParserPipeline for composable parsing steps: encoding fix → version detection → XML parsing → index building.
34 35 36 37 38 39 |
# File 'lib/xmi/sparx/root.rb', line 34 def parse_xml(xml_content) ctx = ParserPipeline.run( { xml: xml_content, root_class: self }, ) ctx[:root] end |
Instance Method Details
#build_index ⇒ Sparx::Index
Build index for fast lookups
47 48 49 |
# File 'lib/xmi/sparx/root.rb', line 47 def build_index @index = Index.new(self) end |
#index ⇒ Sparx::Index
Access the index (builds on first access if needed)
53 54 55 |
# File 'lib/xmi/sparx/root.rb', line 53 def index @index || build_index end |