lutaml 0.9.33 → 0.9.35
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/Gemfile +8 -0
- data/bin/plantuml2lutaml +1 -1
- data/bin/yaml2lutaml +6 -4
- data/exe/lutaml-wsd2uml +1 -1
- data/exe/lutaml-yaml2uml +6 -4
- data/lib/lutaml/command_line.rb +3 -3
- data/lib/lutaml/formatter/base.rb +3 -3
- data/lib/lutaml/formatter/graphviz.rb +10 -10
- data/lib/lutaml/sysml/block.rb +1 -1
- data/lib/lutaml/sysml/constraint_block.rb +1 -1
- data/lib/lutaml/sysml/nested_connector_end.rb +1 -1
- data/lib/lutaml/sysml/requirement.rb +41 -33
- data/lib/lutaml/sysml/xmi_file.rb +382 -355
- data/lib/lutaml/uml/actor.rb +1 -1
- data/lib/lutaml/uml/association.rb +5 -5
- data/lib/lutaml/uml/connector.rb +1 -1
- data/lib/lutaml/uml/constructor_end.rb +1 -1
- data/lib/lutaml/uml/dependency.rb +1 -1
- data/lib/lutaml/uml/document.rb +0 -1
- data/lib/lutaml/uml/formatter/base.rb +2 -2
- data/lib/lutaml/uml/formatter/graphviz.rb +10 -10
- data/lib/lutaml/uml/has_members.rb +4 -4
- data/lib/lutaml/uml/instance.rb +1 -1
- data/lib/lutaml/uml/model.rb +1 -1
- data/lib/lutaml/uml/node/class_node.rb +1 -1
- data/lib/lutaml/uml/operation.rb +2 -2
- data/lib/lutaml/uml/package.rb +2 -2
- data/lib/lutaml/uml/parsers/dsl.rb +7 -4
- data/lib/lutaml/uml/parsers/dsl_preprocessor.rb +6 -3
- data/lib/lutaml/uml/property.rb +4 -4
- data/lib/lutaml/uml/top_element.rb +2 -2
- data/lib/lutaml/uml/top_element_attribute.rb +1 -1
- data/lib/lutaml/uml/value.rb +2 -2
- data/lib/lutaml/version.rb +1 -1
- data/lib/lutaml/xmi/liquid_drops/association_drop.rb +11 -2
- data/lib/lutaml/xmi/liquid_drops/attribute_drop.rb +1 -1
- data/lib/lutaml/xmi/liquid_drops/connector_drop.rb +48 -0
- data/lib/lutaml/xmi/liquid_drops/data_type_drop.rb +2 -1
- data/lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb +1 -1
- data/lib/lutaml/xmi/liquid_drops/klass_drop.rb +9 -3
- data/lib/lutaml/xmi/liquid_drops/source_target_drop.rb +36 -0
- data/lib/lutaml/xmi/parsers/xmi_base.rb +39 -19
- data/lib/lutaml/xmi.rb +0 -1
- data/lutaml.gemspec +2 -10
- metadata +6 -103
- data/lib/lutaml/xmi/version.rb +0 -5
data/lib/lutaml/uml/actor.rb
CHANGED
@@ -19,24 +19,24 @@ module Lutaml
|
|
19
19
|
:action
|
20
20
|
|
21
21
|
# TODO: move to Parslet::Transform
|
22
|
-
def members=(value)
|
22
|
+
def members=(value) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
|
23
23
|
value.group_by { |member| member.keys.first }
|
24
24
|
.each do |(type, group)|
|
25
|
-
if %w[owner_end member_end].include?(type)
|
25
|
+
if %w[owner_end member_end].include?(type) # rubocop:disable Performance/CollectionLiteralInLoop
|
26
26
|
group.each do |member|
|
27
27
|
member.each_pair do |key, member_value|
|
28
|
-
public_send(:"#{
|
28
|
+
public_send(:"#{association_type(key)}=", member_value)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
next
|
32
32
|
end
|
33
33
|
attribute_value = group.map(&:values).flatten
|
34
34
|
if attribute_value.length == 1 && !attribute_value.first.is_a?(Hash)
|
35
|
-
next public_send(:"#{
|
35
|
+
next public_send(:"#{association_type(type)}=",
|
36
36
|
attribute_value.first)
|
37
37
|
end
|
38
38
|
|
39
|
-
public_send(:"#{
|
39
|
+
public_send(:"#{association_type(type)}=", attribute_value)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
data/lib/lutaml/uml/connector.rb
CHANGED
data/lib/lutaml/uml/document.rb
CHANGED
@@ -8,7 +8,7 @@ module Lutaml
|
|
8
8
|
module Formatter
|
9
9
|
class Base
|
10
10
|
class << self
|
11
|
-
def inherited(subclass)
|
11
|
+
def inherited(subclass) # rubocop:disable Lint/MissingSuper
|
12
12
|
Formatter.all << subclass
|
13
13
|
end
|
14
14
|
|
@@ -39,7 +39,7 @@ module Lutaml
|
|
39
39
|
@type = value.to_s.strip.downcase.to_sym
|
40
40
|
end
|
41
41
|
|
42
|
-
def format(node)
|
42
|
+
def format(node) # rubocop:disable Metrics/CyclomaticComplexity
|
43
43
|
case node
|
44
44
|
when Node::Field then format_field(node)
|
45
45
|
when Node::Method then format_method(node)
|
@@ -41,7 +41,7 @@ module Lutaml
|
|
41
41
|
cmapx
|
42
42
|
].freeze
|
43
43
|
|
44
|
-
def initialize(attributes = {})
|
44
|
+
def initialize(attributes = {}) # rubocop:disable Metrics/MethodLength
|
45
45
|
super
|
46
46
|
|
47
47
|
@graph = Attributes.new
|
@@ -88,7 +88,7 @@ module Lutaml
|
|
88
88
|
.gsub("]", "]")
|
89
89
|
end
|
90
90
|
|
91
|
-
def format_field(node)
|
91
|
+
def format_field(node) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
92
92
|
symbol = ACCESS_SYMBOLS[node.visibility]
|
93
93
|
result = "#{symbol}#{node.name}"
|
94
94
|
if node.type
|
@@ -104,7 +104,7 @@ module Lutaml
|
|
104
104
|
result
|
105
105
|
end
|
106
106
|
|
107
|
-
def format_method(node)
|
107
|
+
def format_method(node) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength
|
108
108
|
symbol = ACCESS_SYMBOLS[node.access]
|
109
109
|
result = "#{symbol} #{node.name}"
|
110
110
|
if node.arguments
|
@@ -130,7 +130,7 @@ module Lutaml
|
|
130
130
|
%{#{graph_parent_name} -> #{graph_node_name}#{graph_attributes}}
|
131
131
|
end
|
132
132
|
|
133
|
-
def generate_graph_relationship_attributes(node)
|
133
|
+
def generate_graph_relationship_attributes(node) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
|
134
134
|
attributes = Attributes.new
|
135
135
|
if %w[dependency realizes].include?(node.member_end_type)
|
136
136
|
attributes["style"] = "dashed"
|
@@ -197,7 +197,7 @@ module Lutaml
|
|
197
197
|
"#{res} #{cardinality['min']}..#{cardinality['max']}"
|
198
198
|
end
|
199
199
|
|
200
|
-
def format_member_rows(members, hide_members)
|
200
|
+
def format_member_rows(members, hide_members) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity
|
201
201
|
unless !hide_members && members&.length&.positive?
|
202
202
|
return <<~HEREDOC.chomp
|
203
203
|
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
|
@@ -218,7 +218,7 @@ module Lutaml
|
|
218
218
|
field_table
|
219
219
|
end
|
220
220
|
|
221
|
-
def format_class(node, hide_members)
|
221
|
+
def format_class(node, hide_members) # rubocop:disable Metrics/AbcSize
|
222
222
|
name = ["<B>#{node.name}</B>"]
|
223
223
|
name.unshift("«#{node.keyword}»") if node.keyword
|
224
224
|
name_html = <<~HEREDOC
|
@@ -246,7 +246,7 @@ module Lutaml
|
|
246
246
|
HEREDOC
|
247
247
|
end
|
248
248
|
|
249
|
-
def format_document(node)
|
249
|
+
def format_document(node) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
|
250
250
|
@fontname = node.fontname || DEFAULT_CLASS_FONT
|
251
251
|
@node["fontname"] = "#{@fontname}-bold"
|
252
252
|
|
@@ -270,8 +270,8 @@ module Lutaml
|
|
270
270
|
associations = node.classes.map(&:associations).compact.flatten +
|
271
271
|
node.associations
|
272
272
|
if node.groups
|
273
|
-
associations =
|
274
|
-
|
273
|
+
associations = sort_by_document_grouping(node.groups,
|
274
|
+
associations)
|
275
275
|
end
|
276
276
|
classes_names = node.classes.map(&:name)
|
277
277
|
associations = associations.map do |assoc_node|
|
@@ -302,7 +302,7 @@ module Lutaml
|
|
302
302
|
|
303
303
|
protected
|
304
304
|
|
305
|
-
def
|
305
|
+
def sort_by_document_grouping(groups, associations) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
|
306
306
|
result = []
|
307
307
|
groups.each do |batch|
|
308
308
|
batch.each do |group_name|
|
@@ -6,22 +6,22 @@ module Lutaml
|
|
6
6
|
class UnknownMemberTypeError < StandardError; end
|
7
7
|
|
8
8
|
# TODO: move to Parslet::Transform
|
9
|
-
def members=(value)
|
9
|
+
def members=(value) # rubocop:disable Metrics/AbcSize
|
10
10
|
value.group_by { |member| member.keys.first }
|
11
11
|
.each do |(type, group)|
|
12
12
|
attribute_value = group.map(&:values).flatten
|
13
13
|
if attribute_value.length == 1 && !attribute_value.first.is_a?(Hash)
|
14
|
-
next public_send(:"#{
|
14
|
+
next public_send(:"#{association_type(type)}=",
|
15
15
|
attribute_value.first)
|
16
16
|
end
|
17
17
|
|
18
|
-
public_send(:"#{
|
18
|
+
public_send(:"#{association_type(type)}=", attribute_value)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
22
|
private
|
23
23
|
|
24
|
-
def
|
24
|
+
def association_type(type)
|
25
25
|
return type if respond_to?(:"#{type}=")
|
26
26
|
|
27
27
|
raise(UnknownMemberTypeError, "Unknown member type: #{type}")
|
data/lib/lutaml/uml/instance.rb
CHANGED
data/lib/lutaml/uml/model.rb
CHANGED
@@ -19,7 +19,7 @@ module Lutaml
|
|
19
19
|
@modifier = value.to_s # TODO: Validate?
|
20
20
|
end
|
21
21
|
|
22
|
-
def members=(value)
|
22
|
+
def members=(value) # rubocop:disable Metrics/MethodLength
|
23
23
|
@members = value.to_a.map do |member|
|
24
24
|
type = member.to_a[0][0] # TODO: This is dumb
|
25
25
|
attributes = member.to_a[0][1]
|
data/lib/lutaml/uml/operation.rb
CHANGED
data/lib/lutaml/uml/package.rb
CHANGED
@@ -6,9 +6,9 @@ module Lutaml
|
|
6
6
|
include HasAttributes
|
7
7
|
|
8
8
|
attr_accessor :imports, :contents
|
9
|
-
attr_reader :
|
9
|
+
attr_reader :data_types, :children_packages
|
10
10
|
|
11
|
-
def initialize(attributes)
|
11
|
+
def initialize(attributes) # rubocop:disable Lint/MissingSuper
|
12
12
|
update_attributes(attributes)
|
13
13
|
@children_packages ||= packages.map do |pkg|
|
14
14
|
[pkg, pkg.packages, pkg.packages.map(&:children_packages)]
|
@@ -74,7 +74,8 @@ module Lutaml
|
|
74
74
|
rule(:spaces) { match("\s").repeat(1) }
|
75
75
|
rule(:spaces?) { spaces.maybe }
|
76
76
|
rule(:whitespace) do
|
77
|
-
(match("\s") | match(" ") | match("\r?\n") | match("\r") | str(";"))
|
77
|
+
(match("\s") | match(" ") | match("\r?\n") | match("\r") | str(";"))
|
78
|
+
.repeat(1)
|
78
79
|
end
|
79
80
|
rule(:whitespace?) { whitespace.maybe }
|
80
81
|
rule(:name) { match["a-zA-Z0-9 _-"].repeat(1) }
|
@@ -83,7 +84,8 @@ module Lutaml
|
|
83
84
|
spaces? >> str("**") >> (newline.absent? >> any).repeat.as(:comments)
|
84
85
|
end
|
85
86
|
rule(:comment_multiline_definition) do
|
86
|
-
spaces? >> str("*|") >> (str("|*").absent? >> any)
|
87
|
+
spaces? >> str("*|") >> (str("|*").absent? >> any)
|
88
|
+
.repeat.as(:comments) >> whitespace? >> str("|*")
|
87
89
|
end
|
88
90
|
rule(:class_name_chars) { match('(?:[a-zA-Z0-9 _-]|\:|\.)').repeat(1) }
|
89
91
|
rule(:class_name) do
|
@@ -206,7 +208,7 @@ module Lutaml
|
|
206
208
|
|
207
209
|
rule(:association_keyword) { kw_association >> spaces }
|
208
210
|
|
209
|
-
%w[owner member].each do |association_end_type|
|
211
|
+
%w[owner member].each do |association_end_type| # rubocop:disable Metrics/BlockLength
|
210
212
|
rule("#{association_end_type}_cardinality") do
|
211
213
|
spaces? >>
|
212
214
|
str("[") >>
|
@@ -303,7 +305,8 @@ module Lutaml
|
|
303
305
|
str("definition") >>
|
304
306
|
whitespace? >>
|
305
307
|
str("{") >>
|
306
|
-
((str("\\") >> any) | (str("}").absent? >> any))
|
308
|
+
((str("\\") >> any) | (str("}").absent? >> any))
|
309
|
+
.repeat.maybe.as(:definition) >>
|
307
310
|
str("}")
|
308
311
|
end
|
309
312
|
|
@@ -38,7 +38,7 @@ module Lutaml
|
|
38
38
|
line.gsub(%r{//.*}, "")
|
39
39
|
end
|
40
40
|
|
41
|
-
def process_include_line(include_root, line)
|
41
|
+
def process_include_line(include_root, line) # rubocop:disable Metrics/MethodLength
|
42
42
|
include_path_match = line.match(/^\s*include\s+(.+)/)
|
43
43
|
return line if include_path_match.nil? || line =~ /^\s\*\*/
|
44
44
|
|
@@ -51,8 +51,11 @@ module Lutaml
|
|
51
51
|
process_comment_line(line)
|
52
52
|
end
|
53
53
|
rescue Errno::ENOENT
|
54
|
-
puts(
|
55
|
-
|
54
|
+
puts(
|
55
|
+
"No such file or directory @ rb_sysopen - #{path_to_file}, " \
|
56
|
+
"include file paths need to be supplied relative to the main " \
|
57
|
+
"document",
|
58
|
+
)
|
56
59
|
end
|
57
60
|
end
|
58
61
|
end
|
data/lib/lutaml/uml/property.rb
CHANGED
@@ -3,14 +3,14 @@
|
|
3
3
|
module Lutaml
|
4
4
|
module Uml
|
5
5
|
class Property < TopElement
|
6
|
-
attr_accessor :type,
|
6
|
+
attr_accessor :type, # rubocop:disable Naming/MethodName
|
7
7
|
:aggregation,
|
8
8
|
:association,
|
9
9
|
:is_derived,
|
10
10
|
:lowerValue,
|
11
11
|
:upperValue
|
12
12
|
|
13
|
-
def initialize
|
13
|
+
def initialize # rubocop:disable Lint/MissingSuper
|
14
14
|
@name = nil
|
15
15
|
@xmi_id = nil
|
16
16
|
@xmi_uuid = nil
|
@@ -19,8 +19,8 @@ module Lutaml
|
|
19
19
|
@namespace = nil
|
20
20
|
@is_derived = false
|
21
21
|
@visibility = "public"
|
22
|
-
@lowerValue = "1"
|
23
|
-
@upperValue = "1"
|
22
|
+
@lowerValue = "1" # rubocop:disable Naming/VariableName
|
23
|
+
@upperValue = "1" # rubocop:disable Naming/VariableName
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -5,8 +5,8 @@ module Lutaml
|
|
5
5
|
class TopElement
|
6
6
|
include HasAttributes
|
7
7
|
|
8
|
+
attr_reader :definition
|
8
9
|
attr_accessor :name,
|
9
|
-
:definition,
|
10
10
|
:xmi_id,
|
11
11
|
:xmi_uuid,
|
12
12
|
:namespace,
|
@@ -24,7 +24,7 @@ module Lutaml
|
|
24
24
|
end
|
25
25
|
# rubocop:enable Rails/ActiveRecordAliases
|
26
26
|
|
27
|
-
def full_name
|
27
|
+
def full_name # rubocop:disable Metrics/MethodLength
|
28
28
|
if name == nil
|
29
29
|
return nil
|
30
30
|
end
|
data/lib/lutaml/uml/value.rb
CHANGED
data/lib/lutaml/version.rb
CHANGED
@@ -5,7 +5,7 @@ module Lutaml
|
|
5
5
|
class AssociationDrop < Liquid::Drop
|
6
6
|
include Parsers::XMIBase
|
7
7
|
|
8
|
-
def initialize( # rubocop:disable Lint/MissingSuper,Metrics/ParameterLists
|
8
|
+
def initialize( # rubocop:disable Lint/MissingSuper,Metrics/ParameterLists,Metrics/MethodLength
|
9
9
|
xmi_id:,
|
10
10
|
member_end:,
|
11
11
|
member_end_type:,
|
@@ -14,7 +14,8 @@ module Lutaml
|
|
14
14
|
member_end_xmi_id:,
|
15
15
|
owner_end:,
|
16
16
|
owner_end_xmi_id:,
|
17
|
-
definition
|
17
|
+
definition:,
|
18
|
+
options:
|
18
19
|
)
|
19
20
|
@xmi_id = xmi_id
|
20
21
|
@member_end = member_end
|
@@ -25,6 +26,9 @@ module Lutaml
|
|
25
26
|
@owner_end = owner_end
|
26
27
|
@owner_end_xmi_id = owner_end_xmi_id
|
27
28
|
@definition = definition
|
29
|
+
@options = options
|
30
|
+
@xmi_root_model = options[:xmi_root_model]
|
31
|
+
@id_name_mapping = options[:id_name_mapping]
|
28
32
|
end
|
29
33
|
|
30
34
|
def xmi_id
|
@@ -62,6 +66,11 @@ module Lutaml
|
|
62
66
|
def definition
|
63
67
|
@definition
|
64
68
|
end
|
69
|
+
|
70
|
+
def connector
|
71
|
+
connector = fetch_connector(@xmi_id)
|
72
|
+
::Lutaml::XMI::ConnectorDrop.new(connector)
|
73
|
+
end
|
65
74
|
end
|
66
75
|
end
|
67
76
|
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Lutaml
|
4
|
+
module XMI
|
5
|
+
class ConnectorDrop < Liquid::Drop
|
6
|
+
include Parsers::XMIBase
|
7
|
+
|
8
|
+
def initialize(model, options = {}) # rubocop:disable Lint/MissingSuper
|
9
|
+
@model = model
|
10
|
+
@options = options
|
11
|
+
@xmi_root_model = options[:xmi_root_model]
|
12
|
+
@id_name_mapping = options[:id_name_mapping]
|
13
|
+
end
|
14
|
+
|
15
|
+
def idref
|
16
|
+
@model.idref
|
17
|
+
end
|
18
|
+
|
19
|
+
def name
|
20
|
+
@model.name
|
21
|
+
end
|
22
|
+
|
23
|
+
def type
|
24
|
+
@model&.properties&.ea_type
|
25
|
+
end
|
26
|
+
|
27
|
+
def documentation
|
28
|
+
@model&.documentation&.value
|
29
|
+
end
|
30
|
+
|
31
|
+
def ea_type
|
32
|
+
@model&.properties&.ea_type
|
33
|
+
end
|
34
|
+
|
35
|
+
def direction
|
36
|
+
@model&.properties&.direction
|
37
|
+
end
|
38
|
+
|
39
|
+
def source
|
40
|
+
::Lutaml::XMI::SourceTargetDrop.new(@model.source)
|
41
|
+
end
|
42
|
+
|
43
|
+
def target
|
44
|
+
::Lutaml::XMI::SourceTargetDrop.new(@model.target)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -77,6 +77,7 @@ module Lutaml
|
|
77
77
|
owner_end: owner_end,
|
78
78
|
owner_end_xmi_id: xmi_id,
|
79
79
|
definition: definition,
|
80
|
+
options: @options,
|
80
81
|
)
|
81
82
|
end
|
82
83
|
end.compact
|
@@ -97,7 +98,7 @@ module Lutaml
|
|
97
98
|
end
|
98
99
|
end
|
99
100
|
|
100
|
-
def is_abstract # rubocop:disable Naming/PredicateName
|
101
|
+
def is_abstract # rubocop:disable Naming/PredicateName,Naming/PredicatePrefix
|
101
102
|
doc_node_attribute_value(@model.id, "isAbstract")
|
102
103
|
end
|
103
104
|
|
@@ -72,9 +72,14 @@ module Lutaml
|
|
72
72
|
def associations # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity,Metrics/MethodLength
|
73
73
|
return if !@matched_element ||
|
74
74
|
!@matched_element.links ||
|
75
|
-
|
75
|
+
(
|
76
|
+
@matched_element.links.association.empty? &&
|
77
|
+
@matched_element.links.generalization.empty?
|
78
|
+
)
|
76
79
|
|
77
|
-
@matched_element.links.association
|
80
|
+
links = @matched_element.links.association +
|
81
|
+
@matched_element.links.generalization
|
82
|
+
links.map do |assoc|
|
78
83
|
link_member = assoc.start == xmi_id ? "end" : "start"
|
79
84
|
link_owner_name = link_member == "start" ? "end" : "start"
|
80
85
|
|
@@ -100,6 +105,7 @@ module Lutaml
|
|
100
105
|
owner_end: owner_end,
|
101
106
|
owner_end_xmi_id: xmi_id,
|
102
107
|
definition: definition,
|
108
|
+
options: @options,
|
103
109
|
)
|
104
110
|
end
|
105
111
|
end.compact
|
@@ -143,7 +149,7 @@ module Lutaml
|
|
143
149
|
!!@klass_guidance
|
144
150
|
end
|
145
151
|
|
146
|
-
def is_abstract # rubocop:disable Naming/PredicateName
|
152
|
+
def is_abstract # rubocop:disable Naming/PredicateName,Naming/PredicatePrefix
|
147
153
|
doc_node_attribute_value(@model.id, "isAbstract")
|
148
154
|
end
|
149
155
|
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Lutaml
|
4
|
+
module XMI
|
5
|
+
class SourceTargetDrop < Liquid::Drop
|
6
|
+
include Parsers::XMIBase
|
7
|
+
|
8
|
+
def initialize(model, options = {}) # rubocop:disable Lint/MissingSuper
|
9
|
+
@model = model
|
10
|
+
@options = options
|
11
|
+
@xmi_root_model = options[:xmi_root_model]
|
12
|
+
@id_name_mapping = options[:id_name_mapping]
|
13
|
+
end
|
14
|
+
|
15
|
+
def idref
|
16
|
+
@model.idref
|
17
|
+
end
|
18
|
+
|
19
|
+
def name
|
20
|
+
@model&.role&.name
|
21
|
+
end
|
22
|
+
|
23
|
+
def type
|
24
|
+
@model&.model&.name
|
25
|
+
end
|
26
|
+
|
27
|
+
def documentation
|
28
|
+
@model&.documentation&.value
|
29
|
+
end
|
30
|
+
|
31
|
+
def multiplicity
|
32
|
+
@model&.type&.multiplicity
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|