evt-entity_projection 2.0.1.2 → 2.0.1.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0005fef126b475820dff8fa3fca226c45006b18885a11884e38af764fe1c8991
|
4
|
+
data.tar.gz: 3dd88eb651c010b1f3db931ac6a928acb5682af2da92d8fe43b9a1fbe4f3d7a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b482a3266997342ede9f053bc4210805526a5b7c959e21b26f078571d4e7a87f6e4832c704142ed33c6845789d5750287a09aeb4f8368c8777669b40b1a161ea
|
7
|
+
data.tar.gz: bbe4cfc0e3223080142f939c2c5f33951f8c7ac43848cdf3b22e31eb80a693caf4752ff909713f63052920f07cad73dfd1938635c1e8d5dba6335ac9d2bac803
|
@@ -13,11 +13,23 @@ module EntityProjection
|
|
13
13
|
end
|
14
14
|
|
15
15
|
module ApplyMethod
|
16
|
-
|
17
|
-
|
16
|
+
module EventData
|
17
|
+
class Example
|
18
|
+
include EntityProjection
|
18
19
|
|
19
|
-
|
20
|
-
|
20
|
+
def apply(event_data)
|
21
|
+
entity.some_attribute = event_data.data[:attribute]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
module Message
|
27
|
+
class Example
|
28
|
+
include EntityProjection
|
29
|
+
|
30
|
+
def apply(message)
|
31
|
+
entity.some_attribute = message.some_attribute
|
32
|
+
end
|
21
33
|
end
|
22
34
|
end
|
23
35
|
end
|
@@ -2,7 +2,7 @@ module EntityProjection
|
|
2
2
|
def self.included(cls)
|
3
3
|
cls.class_exec do
|
4
4
|
include Initializer
|
5
|
-
include
|
5
|
+
include TemplateMethod
|
6
6
|
include Log::Dependency
|
7
7
|
|
8
8
|
extend Build
|
@@ -13,7 +13,7 @@ module EntityProjection
|
|
13
13
|
extend Register
|
14
14
|
extend EntityNameMacro
|
15
15
|
|
16
|
-
|
16
|
+
template_method :configure
|
17
17
|
|
18
18
|
initializer :entity
|
19
19
|
end
|
@@ -139,6 +139,10 @@ module EntityProjection
|
|
139
139
|
|
140
140
|
unless handler.nil?
|
141
141
|
public_send(handler, event)
|
142
|
+
else
|
143
|
+
if respond_to?(:apply)
|
144
|
+
apply(event)
|
145
|
+
end
|
142
146
|
end
|
143
147
|
|
144
148
|
logger.info(tag: :apply) { "Applied event (Event class: #{event.class.name})" }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-entity_projection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.1.
|
4
|
+
version: 2.0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Eventide Project
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-messaging
|
@@ -70,7 +70,7 @@ homepage: https://github.com/eventide-project/entity-projection
|
|
70
70
|
licenses:
|
71
71
|
- MIT
|
72
72
|
metadata: {}
|
73
|
-
post_install_message:
|
73
|
+
post_install_message:
|
74
74
|
rdoc_options: []
|
75
75
|
require_paths:
|
76
76
|
- lib
|
@@ -85,8 +85,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0'
|
87
87
|
requirements: []
|
88
|
-
rubygems_version: 3.
|
89
|
-
signing_key:
|
88
|
+
rubygems_version: 3.4.10
|
89
|
+
signing_key:
|
90
90
|
specification_version: 4
|
91
91
|
summary: Projects event data into an entity
|
92
92
|
test_files: []
|