evt-messaging-postgres 0.5.1.0 → 0.6.0.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8786da31533ad8571ca2f4af5285070fe3bd4383
|
4
|
+
data.tar.gz: ffb9f35b70af3ae69df95c1988726a598ea9f8e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdd978e7b09a994f1c36064dd714da540eecf3e80eabe3491a790d0a3db0f3c839a5e4de2d012e9b76793771b4ca38f6aafa89814f7f62f51d496293ae8ec1bc
|
7
|
+
data.tar.gz: 335f52ba47f31994d4f0862c829ddcf35dde09adb4c6e11cdeb3e0ef1b776d735b753d47bfb7d4b61ccbdd15a3f7f4b1ca65a2d235ce2502d845779a311a503b
|
@@ -1,23 +1,59 @@
|
|
1
1
|
module Messaging
|
2
2
|
module Postgres
|
3
3
|
module StreamName
|
4
|
+
extend self
|
5
|
+
|
4
6
|
def self.included(cls)
|
5
|
-
cls.
|
6
|
-
|
7
|
+
cls.extend Macro
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.activate
|
11
|
+
target_class ||= Object
|
12
|
+
macro_module = Macro
|
13
|
+
return if target_class.is_a? macro_module
|
14
|
+
target_class.extend(macro_module)
|
15
|
+
end
|
16
|
+
|
17
|
+
module Macro
|
18
|
+
def category_macro(category)
|
19
|
+
category = Casing::Camel.(category, symbol_to_string: true)
|
20
|
+
self.send :define_method, :category do
|
21
|
+
@category ||= category
|
22
|
+
end
|
23
|
+
|
24
|
+
self.send :define_method, :category= do |category|
|
25
|
+
@category = category
|
26
|
+
end
|
7
27
|
end
|
28
|
+
alias :category :category_macro
|
8
29
|
end
|
9
30
|
|
10
|
-
|
11
|
-
|
31
|
+
def stream_name(id, category=nil, type: nil)
|
32
|
+
category ||= self.category
|
33
|
+
EventSource::Postgres::StreamName.stream_name(category, id, type: type)
|
34
|
+
end
|
12
35
|
|
13
36
|
def category_stream_name(category=nil)
|
14
37
|
category ||= self.category
|
15
38
|
category
|
16
39
|
end
|
17
40
|
|
41
|
+
def command_stream_name(id, category=nil)
|
42
|
+
category ||= self.category
|
43
|
+
EventSource::Postgres::StreamName.stream_name(category, id, type: 'command')
|
44
|
+
end
|
45
|
+
|
18
46
|
def command_category_stream_name(category=nil)
|
19
47
|
category ||= self.category
|
20
|
-
EventSource::StreamName.stream_name
|
48
|
+
EventSource::Postgres::StreamName.stream_name(category, type: 'command')
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.get_category(stream_name)
|
52
|
+
EventSource::Postgres::StreamName.get_category(stream_name)
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.get_id(stream_name)
|
56
|
+
EventSource::Postgres::StreamName.get_id stream_name
|
21
57
|
end
|
22
58
|
end
|
23
59
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-messaging-postgres
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0.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: 2017-02-
|
11
|
+
date: 2017-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-messaging
|