ea 0.6.87 → 0.6.88

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: 99939d59c942f5317beae711c6941990df7caa5a2454b842d972f4d7e4d65637
4
- data.tar.gz: 8fe745197a95c0efd97e251e8df6ee7c9fa670c4f4df24b74df02dbc9e5efeea
3
+ metadata.gz: fbe22f7a331d0a4785835dc942b2c14a1a50d582494d284310b155deb14e95e8
4
+ data.tar.gz: 31bca9c2e54461cd2da07d75f92d3db79c0fc610a7ab9eb3a9273cfd9ade56ac
5
5
  SHA512:
6
- metadata.gz: 53dc830d37f4d4f4fcbbf414ecdadeef7ffd3e8a37b6212e9d4b9ee57cceb577ae2f4adc65cc513623c339b2e7514e73aa2842364ece26eb57c9f2e38e66bc80
7
- data.tar.gz: fb56b46ddec66e8b59ead615032d2c8a06e5abb380e4d2f93d3d3fc09dae721b0f75232a0a0b4f9107e2617f544c7a0b028c540eb56679426bcc9e4c1a220e7f
6
+ metadata.gz: 48f42070549a8b34e6cf125431675092834b990052e669f56e00ad291b16cf166b7c302d90be870cf440a80f14a5264a6c22191d8aeff15fa91320c10989fc24
7
+ data.tar.gz: b83c90fb2b516341ac1ca1621482f9ae1438e339a242170d5cccb6144f6e15eb37188499dbe102697d22843794a349d25980236ef5302abff96d0da7bd8f2efb
data/lib/ea/version.rb CHANGED
@@ -4,5 +4,5 @@ module Ea
4
4
  # Gem release version. Extracted to its own file so the
5
5
  # `gem-release` tool's `gem bump` can find and update it via the
6
6
  # standard `lib/<gem>/version.rb` convention.
7
- VERSION = "0.6.87"
7
+ VERSION = "0.6.88"
8
8
  end
@@ -4,10 +4,11 @@ module Ea
4
4
  module Xmi
5
5
  module LiquidDrops
6
6
  class AttributeDrop < Liquid::Drop
7
- def initialize(model, options = {}) # rubocop:disable Lint/MissingSuper
7
+ def initialize(model, options = {}, guidance = nil) # rubocop:disable Lint/MissingSuper
8
8
  @model = model
9
9
  @options = options
10
10
  @lookup = options[:lookup]
11
+ @guidance = guidance
11
12
  end
12
13
 
13
14
  def id
@@ -43,7 +44,7 @@ module Ea
43
44
 
44
45
  if defn.nil? || defn.empty?
45
46
  defn = @lookup.lookup_connector_def_by_associationclass(
46
- @model.association,
47
+ @model.association
47
48
  )
48
49
  end
49
50
 
@@ -51,29 +52,48 @@ module Ea
51
52
  end
52
53
 
53
54
  def association
54
- if @options[:with_assoc] && @model.association
55
- @model.association
56
- end
55
+ return unless @options[:with_assoc] && @model.association
56
+
57
+ @model.association
57
58
  end
58
59
 
59
60
  def association_connector
60
61
  return unless @model.association
61
62
 
62
63
  connector = @lookup.fetch_connector(@model.association)
63
- if connector
64
- ::Ea::Xmi::LiquidDrops::ConnectorDrop.new(connector, @options)
65
- end
64
+ return unless connector
65
+
66
+ ::Ea::Xmi::LiquidDrops::ConnectorDrop.new(connector, @options)
66
67
  end
67
68
 
68
69
  def type_ns
69
- if @options[:with_assoc] && @model.association
70
- @model.type_ns
71
- end
70
+ return unless @options[:with_assoc] && @model.association
71
+
72
+ @model.type_ns
72
73
  end
73
74
 
74
75
  def stereotype
75
76
  @lookup.doc_node_attribute_value(@model.xmi_id, "stereotype")
76
77
  end
78
+
79
+ def used?
80
+ if @guidance
81
+ col_name = name
82
+ attr = @guidance["attributes"].find { |a| a["name"] == col_name }
83
+ return attr["used"].to_s if attr
84
+ end
85
+
86
+ "true"
87
+ end
88
+
89
+ def guidance
90
+ return unless @guidance
91
+
92
+ col_name = "#{name_ns}:#{name}"
93
+ attr = @guidance["attributes"].find { |a| a["name"] == col_name }
94
+
95
+ attr["guidance"] if attr
96
+ end
77
97
  end
78
98
  end
79
99
  end
@@ -49,8 +49,8 @@ module Ea
49
49
  def attributes
50
50
  Array(@model.attributes).filter_map do |owned_attr|
51
51
  if @options[:with_assoc] || owned_attr.association.nil?
52
- ::Ea::Xmi::LiquidDrops::AttributeDrop.new(owned_attr,
53
- @options)
52
+ ::Ea::Xmi::LiquidDrops::AttributeDrop
53
+ .new(owned_attr, @options, @data_type_guidance)
54
54
  end
55
55
  end
56
56
  end
@@ -87,16 +87,17 @@ module Ea
87
87
 
88
88
  def owned_attributes
89
89
  Array(@model.attributes).filter_map do |owned_attr|
90
- ::Ea::Xmi::LiquidDrops::AttributeDrop.new(owned_attr, @options)
90
+ ::Ea::Xmi::LiquidDrops::AttributeDrop
91
+ .new(owned_attr, @options, @data_type_guidance)
91
92
  end
92
93
  end
93
94
 
94
95
  def generalization
95
- if @model.generalization
96
- ::Ea::Xmi::LiquidDrops::GeneralizationDrop.new(
97
- @model.generalization, @data_type_guidance, @options
98
- )
99
- end
96
+ return unless @model.generalization
97
+
98
+ ::Ea::Xmi::LiquidDrops::GeneralizationDrop.new(
99
+ @model.generalization, @data_type_guidance, @options
100
+ )
100
101
  end
101
102
 
102
103
  def has_guidance?
@@ -74,12 +74,12 @@ module Ea
74
74
  end
75
75
 
76
76
  def guidance
77
- if @guidance
78
- col_name = "#{name_ns}:#{name}"
79
- attr = @guidance["attributes"].find { |a| a["name"] == col_name }
77
+ return unless @guidance
80
78
 
81
- attr["guidance"] if attr
82
- end
79
+ col_name = "#{name_ns}:#{name}"
80
+ attr = @guidance["attributes"].find { |a| a["name"] == col_name }
81
+
82
+ attr["guidance"] if attr
83
83
  end
84
84
  end
85
85
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.87
4
+ version: 0.6.88
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-10-13 00:00:00.000000000 Z
11
+ date: 2026-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lutaml-model