Class: Lutaml::UmlRepository::ClassLookupIndex

Inherits:
Object
  • Object
show all
Defined in:
lib/lutaml/uml_repository/class_lookup_index.rb

Constant Summary collapse

EA_OBJECT_ID_KEY =
:ea_object_id

Instance Method Summary collapse

Constructor Details

#initialize(classes) ⇒ ClassLookupIndex

Returns a new instance of ClassLookupIndex.



8
9
10
11
12
13
14
15
16
# File 'lib/lutaml/uml_repository/class_lookup_index.rb', line 8

def initialize(classes)
  @by_xmi_id = {}
  @by_object_id = {}

  classes.each do |klass|
    @by_xmi_id[klass.xmi_id] = klass if klass.xmi_id
    index_by_ea_object_id(klass)
  end
end

Instance Method Details

#by_object_id(object_id) ⇒ Object



22
23
24
# File 'lib/lutaml/uml_repository/class_lookup_index.rb', line 22

def by_object_id(object_id)
  @by_object_id[object_id]
end

#by_xmi_id(xmi_id) ⇒ Object



18
19
20
# File 'lib/lutaml/uml_repository/class_lookup_index.rb', line 18

def by_xmi_id(xmi_id)
  @by_xmi_id[xmi_id]
end