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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3bdc3f066879a36efeca4609e9aca838d50a6708a1112b403da3c67a2e1d4dc
4
- data.tar.gz: '085cc25361b1aff8bd5ee4910230ceb5420a9830fbaeaa811b60c85b20de8f18'
3
+ metadata.gz: 7fe23c8f2af27bf3016adc461338dab47dcbf0179237fef38e2b30ef068e2adc
4
+ data.tar.gz: 2382b0189342f7e559129af75829c642b4737f934cc2a83821cb2300484813d3
5
5
  SHA512:
6
- metadata.gz: a29744b9dabc937dd635e33b93270a3cdbd28c3735fd8975fd459b0193e98db38cc6e15ad499185135294f4a8fcb10ce0f52c8ecade9ed9ad81dffef23e8245a
7
- data.tar.gz: bbb498bc86c6752dfdbde5a54737cd522d20c2e04e4a6a1a59737c95b2c3c7600d452049412c6338a7dc028b0d33314f606a0fd3af98623e962ef68193d21f00
6
+ metadata.gz: a722350e941888b75fd6437fc7e2b491247cfae144414b400c49d77f522b38cea9b70579010f3bb6bfc5b859058cba6985e65b885e997780bd1aa6d7c3be40b8
7
+ data.tar.gz: 160e71a7c27b78b4d2c582a8de3b6b3fc1815e3f1c915b487cf0dbd06ddd7436ddb0b18e331b4c76483f621982fd2ce0697744b5cd25620436c8374c9bae513f
@@ -1,3 +1,3 @@
1
1
  module Lutaml
2
- VERSION = "0.9.1".freeze
2
+ VERSION = "0.9.2".freeze
3
3
  end
@@ -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
- doc_node = fetch_element(xmi_id)
491
- return unless doc_node
505
+ attribute_node = fetch_attribute_node(xmi_id)
506
+
507
+ return unless attribute_node&.documentation
492
508
 
493
- doc_node.documentation
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.1
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-26 00:00:00.000000000 Z
11
+ date: 2024-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: expressir