aggregate_root 2.5.1 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aggregate_root/instrumented_apply_strategy.rb +34 -0
- data/lib/aggregate_root/version.rb +1 -1
- data/lib/aggregate_root.rb +1 -0
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c8b5d964bf3266c0353d5ab5f0c3131c4f7ec006a86bf32efa9230b08396d8b
|
4
|
+
data.tar.gz: 8ca9aa71d57707f8f956a2230eb70369be02558812b77918a81c38648f1a91c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 911d1311973bed3bd58a015c2063917311c5a658593b3c67c0dd82cec5e7e415513ee795dfdd6dc17026570b3cd8b4bb40db49f958987b891a01e1eb209a9d8d
|
7
|
+
data.tar.gz: 7404ee7fd26f2b39e1dd5df58062bcbc28a650f6c79e68c6d814aad2e8b5fa7aa768cf7dbc5fdc4ac1eaf4669a700c039e768657251450d70857965149a0dc4b
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AggregateRoot
|
4
|
+
class InstrumentedApplyStrategy
|
5
|
+
def initialize(strategy, instrumentation)
|
6
|
+
@strategy = strategy
|
7
|
+
@instrumentation = instrumentation
|
8
|
+
end
|
9
|
+
|
10
|
+
def call(aggregate, event)
|
11
|
+
instrumentation.instrument("apply.aggregate_root",
|
12
|
+
aggregate: aggregate,
|
13
|
+
event: event) do
|
14
|
+
strategy.call(aggregate, event)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def method_missing(method_name, *arguments, &block)
|
19
|
+
if respond_to?(method_name)
|
20
|
+
strategy.public_send(method_name, *arguments, &block)
|
21
|
+
else
|
22
|
+
super
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def respond_to_missing?(method_name, _include_private)
|
27
|
+
strategy.respond_to?(method_name)
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
attr_reader :instrumentation, :strategy
|
33
|
+
end
|
34
|
+
end
|
data/lib/aggregate_root.rb
CHANGED
@@ -6,6 +6,7 @@ require_relative "aggregate_root/transform"
|
|
6
6
|
require_relative "aggregate_root/default_apply_strategy"
|
7
7
|
require_relative "aggregate_root/repository"
|
8
8
|
require_relative "aggregate_root/instrumented_repository"
|
9
|
+
require_relative "aggregate_root/instrumented_apply_strategy"
|
9
10
|
|
10
11
|
module AggregateRoot
|
11
12
|
module OnDSL
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aggregate_root
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arkency
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby_event_store
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.6.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: 2.6.0
|
27
27
|
description:
|
28
28
|
email: dev@arkency.com
|
29
29
|
executables: []
|
@@ -35,6 +35,7 @@ files:
|
|
35
35
|
- lib/aggregate_root.rb
|
36
36
|
- lib/aggregate_root/configuration.rb
|
37
37
|
- lib/aggregate_root/default_apply_strategy.rb
|
38
|
+
- lib/aggregate_root/instrumented_apply_strategy.rb
|
38
39
|
- lib/aggregate_root/instrumented_repository.rb
|
39
40
|
- lib/aggregate_root/repository.rb
|
40
41
|
- lib/aggregate_root/transform.rb
|
@@ -63,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
64
|
- !ruby/object:Gem::Version
|
64
65
|
version: '0'
|
65
66
|
requirements: []
|
66
|
-
rubygems_version: 3.3.
|
67
|
+
rubygems_version: 3.3.26
|
67
68
|
signing_key:
|
68
69
|
specification_version: 4
|
69
70
|
summary: Event sourced aggregate root implementation for RubyEventStore
|