Class: Lutaml::Xmi::XmiLookupService

Inherits:
Object
  • Object
show all
Includes:
Parsers::XmiBase
Defined in:
lib/lutaml/xmi/xmi_lookup_service.rb

Overview

Single bridge between Liquid Drop classes and the XMI document tree. Drops receive an instance of this service instead of including XmiBase directly.

Instance Method Summary collapse

Methods included from Parsers::XmiBase

included, #set_xmi_model, #xmi_index

Methods included from Parsers::XmiClassMembers

#cardinality_min_max_value, #fetch_element, #get_ns_by_xmi_id, #loopup_assoc_def

Methods included from Parsers::XmiConnector

#build_connector_lookup, #connector_labels, #connector_lookup, #connector_name_by_source_or_target, #connector_node_by_id, #connector_source_name, #extract_attribute_name, #extract_cardinality, #fetch_assoc_connector, #fetch_connector, #fetch_connector_name, #fetch_definition_node_value, #fetch_owned_attribute_node, #generalization_association, #index_connector_directions, #member_end_name, #serialize_member_end, #serialize_member_type, #serialize_owned_type

Constructor Details

#initialize(xmi_root_model, id_name_mapping) ⇒ XmiLookupService

Returns a new instance of XmiLookupService.



10
11
12
13
# File 'lib/lutaml/xmi/xmi_lookup_service.rb', line 10

def initialize(xmi_root_model, id_name_mapping)
  @xmi_root_model = xmi_root_model
  @id_name_mapping = id_name_mapping
end

Instance Method Details

#find_matched_element(xmi_id) ⇒ Object

Convenience: find extension element by XMI id (used by Drops for dependency/inheritance lookups)



35
36
37
# File 'lib/lutaml/xmi/xmi_lookup_service.rb', line 35

def find_matched_element(xmi_id)
  xmi_index&.find_element(xmi_id)
end