marmerdo 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/lib/marmerdo/domain_diagram_generator.rb +1 -1
- data/lib/marmerdo/relationship.rb +29 -23
- data/lib/marmerdo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69476fe32f74a4b4a7081f5bf65ce187026b8e3afa257ad7b0c5b3622153bba4
|
4
|
+
data.tar.gz: 7a0c231bdd97fb8a7c68e003d618421b8b5839ddce6cd8672e1f895478f0dd74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08cb33a93c568b1e799aed8824a371d5716b521a6e8437727a304f59f1b806a1b6d56a7bef96cee1d6344fe8558b0db6fc86a5dd7fc002ce764ea54e48b5f9e9'
|
7
|
+
data.tar.gz: 24c9314b548c06974be900afbc46d0e7ab2a98c9a01b36dd936fddff2a676c87f64da9e80a0a87d1a98a153973b504a9bf98fb74eb1374f1dfc49da7c4550aae
|
data/CHANGELOG.md
CHANGED
@@ -19,7 +19,7 @@ module Marmerdo
|
|
19
19
|
# @return [Symbol]
|
20
20
|
attr_reader :type
|
21
21
|
|
22
|
-
# @return [Symbol]
|
22
|
+
# @return [Array<Symbol>]
|
23
23
|
attr_reader :to
|
24
24
|
|
25
25
|
def self.valid_type?(type)
|
@@ -28,30 +28,36 @@ module Marmerdo
|
|
28
28
|
|
29
29
|
def initialize(type:, to:)
|
30
30
|
@type = type.to_sym
|
31
|
-
@to = to.
|
31
|
+
@to = if to.is_a?(Array)
|
32
|
+
to.map(&:to_sym)
|
33
|
+
else
|
34
|
+
[to.to_sym]
|
35
|
+
end
|
32
36
|
end
|
33
37
|
|
34
|
-
def
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
38
|
+
def to_mermaid_str(from)
|
39
|
+
to.map do |t|
|
40
|
+
case type
|
41
|
+
when :inheritance
|
42
|
+
"#{t} <|-- #{from}"
|
43
|
+
when :composition
|
44
|
+
"#{t} *-- #{from}"
|
45
|
+
when :aggregation
|
46
|
+
"#{t} o-- #{from}"
|
47
|
+
when :association
|
48
|
+
"#{from} --> #{t}"
|
49
|
+
when :link_solid
|
50
|
+
"#{from} -- #{t}"
|
51
|
+
when :dependency
|
52
|
+
"#{from} ..> #{t}"
|
53
|
+
when :realization
|
54
|
+
"#{from} ..|> #{t}"
|
55
|
+
when :link_dashed
|
56
|
+
"#{from} .. #{t}"
|
57
|
+
else
|
58
|
+
raise UnknownRelationshipType
|
59
|
+
end
|
60
|
+
end.join("\n")
|
55
61
|
end
|
56
62
|
end
|
57
63
|
end
|
data/lib/marmerdo/version.rb
CHANGED