evt-message_store 0.4.0.0 → 0.5.0.0
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/message_store/controls/stream_name.rb +9 -4
- 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: cfd1183110eee536c2d7aff8c2acbb039438cded104bed3e12d93723d2b855fb
|
4
|
+
data.tar.gz: 8b075b0c325a637fc457d9bf65a7f11648c1044cda4425eb1402e5c72a2c8b62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 754a1fd9d4df96789446c07c7ce61d6d36bd6b778383203a6e73d5985276269f3e7e6ad0aa14d9131bcbcdec3bf4f9419585c341e596c09db49bb95568e5916e
|
7
|
+
data.tar.gz: f885dd05c07551d0cf7931f879c35bad6f8c7e8f2d5244855187512ceba9ddb8bfa5ba82feecc03f574ec15e5508e3de2667d9c5244b3ec1822880cf38f62f54
|
@@ -2,20 +2,25 @@ module MessageStore
|
|
2
2
|
module Controls
|
3
3
|
module StreamName
|
4
4
|
def self.example(category: nil, id: nil, type: nil, types: nil, randomize_category: nil)
|
5
|
-
|
6
|
-
|
5
|
+
if id == :none
|
6
|
+
id = nil
|
7
|
+
else
|
8
|
+
id ||= Identifier::UUID.random
|
9
|
+
end
|
10
|
+
|
11
|
+
category = Category.example(category: category, randomize_category: randomize_category)
|
7
12
|
|
8
13
|
stream_name(category, id, type: type, types: types)
|
9
14
|
end
|
10
15
|
|
11
|
-
def self.stream_name(
|
16
|
+
def self.stream_name(category, id=nil, type: nil, types: nil)
|
12
17
|
types = Array(types)
|
13
18
|
types.unshift(type) unless type.nil?
|
14
19
|
|
15
20
|
type_list = nil
|
16
21
|
type_list = types.join('+') unless types.empty?
|
17
22
|
|
18
|
-
stream_name =
|
23
|
+
stream_name = category
|
19
24
|
stream_name = "#{stream_name}:#{type_list}" unless type_list.nil?
|
20
25
|
stream_name = "#{stream_name}-#{id}" unless id.nil?
|
21
26
|
|