evt-message_store 1.0.0.2 → 1.0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8801f83e81e91245a02981abbf45575805ef584e528b87f180efaaf8b9e2785e
4
- data.tar.gz: e4139dd0db0fd704d0b99242ba86cb1e634217980b562eb662925f2934a4d496
3
+ metadata.gz: 29fa88f21af344f708f838bd36c7f8c3ab2964e25a7553034147992020e6b55f
4
+ data.tar.gz: 5cae9e9e425eda3dcd9ad06260bdca06b493c25cd81fb1b989ec7db4a3153c34
5
5
  SHA512:
6
- metadata.gz: 9f9d53b49c873f2e64a0113d802c122f628e086dda7009fef48f35406c69f38f8bc7c474df29f78d211dcf57ecc361acafc258909a73c6d3f4463a3b91f51046
7
- data.tar.gz: da8e1f9ced2eeb3250b15e1a41de734d4822d62ed9b35965acbc2322b0f6d6e4cd4efe46665888b751b90c93f18550b9c88de71c949e076e17ce038daa4d6d98
6
+ metadata.gz: b9244d42510b000fbc56af9334639bbc804403a56b919cf7c34bdd000622ee2e58129f03f2c7a7d40f47ddfb017f4583e5abafbc072f0491a04e9674217ae30d
7
+ data.tar.gz: 60f37eebeaf18ea08c0fb2bf1e25c2d47b8b4d064d0e4dec196c746c78881e3252b042e04a9a63e2bd146018a282180cbac1dee0a07ece0707ccaa04a4df698c
@@ -20,25 +20,40 @@ module MessageStore
20
20
  stream_name
21
21
  end
22
22
 
23
+ def self.stream_delimiter
24
+ '-'
25
+ end
26
+
27
+ def self.category_delimiter
28
+ ':'
29
+ end
30
+
31
+ def self.type_delimiter
32
+ '+'
33
+ end
34
+
35
+ def self.split(stream_name)
36
+ stream_name.split(stream_delimiter, 2)
37
+ end
38
+
23
39
  def self.get_id(stream_name)
24
- id = stream_name.partition('-').last
25
- id.empty? ? nil : id
40
+ split(stream_name)[1]
26
41
  end
27
42
 
28
43
  def self.get_category(stream_name)
29
- stream_name.split('-').first
44
+ split(stream_name)[0]
30
45
  end
31
46
 
32
47
  def self.category?(stream_name)
33
- !stream_name.include?('-')
48
+ !stream_name.include?(stream_delimiter)
34
49
  end
35
50
 
36
51
  def self.get_type_list(stream_name)
37
- return nil if stream_name.index(':').nil?
52
+ return nil unless stream_name.include?(category_delimiter)
38
53
 
39
54
  category = get_category(stream_name)
40
55
 
41
- category.split(':').last
56
+ category.split(category_delimiter)[1]
42
57
  end
43
58
 
44
59
  def self.get_types(stream_name)
@@ -46,11 +61,11 @@ module MessageStore
46
61
 
47
62
  return [] if type_list.nil?
48
63
 
49
- type_list.split('+')
64
+ type_list.split(type_delimiter)
50
65
  end
51
66
 
52
67
  def self.get_entity_name(stream_name)
53
- get_category(stream_name).split(':').first
68
+ get_category(stream_name).split(category_delimiter)[0]
54
69
  end
55
70
  end
56
71
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evt-message_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.2
4
+ version: 1.0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Eventide Project
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-26 00:00:00.000000000 Z
11
+ date: 2018-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-casing