lutaml 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/lutaml/version.rb +1 -1
- data/lib/lutaml/xmi/parsers/xml.rb +19 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7fe23c8f2af27bf3016adc461338dab47dcbf0179237fef38e2b30ef068e2adc
|
|
4
|
+
data.tar.gz: 2382b0189342f7e559129af75829c642b4737f934cc2a83821cb2300484813d3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a722350e941888b75fd6437fc7e2b491247cfae144414b400c49d77f522b38cea9b70579010f3bb6bfc5b859058cba6985e65b885e997780bd1aa6d7c3be40b8
|
|
7
|
+
data.tar.gz: 160e71a7c27b78b4d2c582a8de3b6b3fc1815e3f1c915b487cf0dbd06ddd7436ddb0b18e331b4c76483f621982fd2ce0697744b5cd25620436c8374c9bae513f
|
data/lib/lutaml/version.rb
CHANGED
|
@@ -483,14 +483,30 @@ module Lutaml
|
|
|
483
483
|
doc_node.properties.send(Shale::Utils.snake_case(attr_name).to_sym)
|
|
484
484
|
end
|
|
485
485
|
|
|
486
|
+
# @param xmi_id [String]
|
|
487
|
+
# @return [Shale::Mapper]
|
|
488
|
+
# @note xpath %(//attribute[@xmi:idref="#{xmi_id}"])
|
|
489
|
+
def fetch_attribute_node(xmi_id)
|
|
490
|
+
attribute_node = nil
|
|
491
|
+
@xmi_root_model.extension.elements.element.each do |e|
|
|
492
|
+
if e.attributes&.attribute
|
|
493
|
+
e.attributes.attribute.each do |a|
|
|
494
|
+
attribute_node = a if a.idref == xmi_id
|
|
495
|
+
end
|
|
496
|
+
end
|
|
497
|
+
end
|
|
498
|
+
attribute_node
|
|
499
|
+
end
|
|
500
|
+
|
|
486
501
|
# @param xmi_id [String]
|
|
487
502
|
# @return [String]
|
|
488
503
|
# @note xpath %(//attribute[@xmi:idref="#{xmi_id}"]/documentation)
|
|
489
504
|
def lookup_attribute_documentation(xmi_id)
|
|
490
|
-
|
|
491
|
-
|
|
505
|
+
attribute_node = fetch_attribute_node(xmi_id)
|
|
506
|
+
|
|
507
|
+
return unless attribute_node&.documentation
|
|
492
508
|
|
|
493
|
-
|
|
509
|
+
attribute_node&.documentation&.value
|
|
494
510
|
end
|
|
495
511
|
|
|
496
512
|
# @param xmi_id [String]
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lutaml
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-06-
|
|
11
|
+
date: 2024-06-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: expressir
|