evt-entity_store 0.5.0.0 → 0.5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/entity_store/controls/entity_store.rb +12 -5
- data/lib/entity_store/entity_store.rb +8 -2
- data/lib/loader.rb +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4a5eee42dfc7a6acd525a25f667e7098e1eb5145930f6b17ee5fbc278fe42a51
|
4
|
+
data.tar.gz: f8094e4c4ffb380b61438309b80c5833c80dffab8a22abc0eb7186916d6cf714
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ac62f1c2d3ce3f34a95556b3e841e6f4eabc112f6f9aee7333d4315830b14429385a447f53f2db1a4801a8dc0bc639ecd553d1604f226dc877fa0a325cde0ee
|
7
|
+
data.tar.gz: 104a9db41c614167cc905a67d5d481cf960ee4018a41f4b28d6d05cb90f7a6c16ce3f47a247e41dddb9aaceacca18c7111a7e86fc10ba26f2b14b08945f835e7
|
@@ -1,18 +1,18 @@
|
|
1
1
|
module EntityStore
|
2
2
|
module Controls
|
3
3
|
module EntityStore
|
4
|
-
def self.example(category: nil, entity_class: nil, projection_class: nil, reader_class: nil, snapshot_class: nil, snapshot_interval: nil)
|
5
|
-
if category.nil? && entity_class.nil? && projection_class.nil? && reader_class.nil? && snapshot_class.nil? && snapshot_interval.nil?
|
4
|
+
def self.example(category: nil, entity_class: nil, projection_class: nil, reader_class: nil, snapshot_class: nil, snapshot_interval: nil, snapshot_interval_keyword: nil)
|
5
|
+
if category.nil? && entity_class.nil? && projection_class.nil? && reader_class.nil? && snapshot_class.nil? && snapshot_interval.nil? && snapshot_interval_keyword.nil?
|
6
6
|
store_class = Example
|
7
7
|
else
|
8
|
-
store_class = example_class(category: category, entity_class: entity_class, projection_class: projection_class, reader_class: reader_class, snapshot_class: snapshot_class, snapshot_interval: snapshot_interval)
|
8
|
+
store_class = example_class(category: category, entity_class: entity_class, projection_class: projection_class, reader_class: reader_class, snapshot_class: snapshot_class, snapshot_interval: snapshot_interval, snapshot_interval_keyword: snapshot_interval_keyword)
|
9
9
|
end
|
10
10
|
|
11
11
|
instance = store_class.build
|
12
12
|
instance
|
13
13
|
end
|
14
14
|
|
15
|
-
def self.example_class(category: nil, entity_class: nil, projection_class: nil, reader_class: nil, snapshot_class: nil, snapshot_interval: nil)
|
15
|
+
def self.example_class(category: nil, entity_class: nil, projection_class: nil, reader_class: nil, snapshot_class: nil, snapshot_interval: nil, snapshot_interval_keyword: nil)
|
16
16
|
if category == :none
|
17
17
|
category = nil
|
18
18
|
else
|
@@ -44,7 +44,14 @@ module EntityStore
|
|
44
44
|
entity entity_class
|
45
45
|
projection projection_class
|
46
46
|
reader reader_class
|
47
|
-
|
47
|
+
|
48
|
+
unless snapshot_class.nil?
|
49
|
+
if snapshot_interval_keyword.nil?
|
50
|
+
snapshot snapshot_class, snapshot_interval
|
51
|
+
else
|
52
|
+
snapshot snapshot_class, interval: snapshot_interval_keyword
|
53
|
+
end
|
54
|
+
end
|
48
55
|
end
|
49
56
|
end
|
50
57
|
|
@@ -65,7 +65,7 @@ module EntityStore
|
|
65
65
|
end
|
66
66
|
|
67
67
|
if instance.projection_class.nil?
|
68
|
-
raise Error, "
|
68
|
+
raise Error, "Projection is not declared"
|
69
69
|
end
|
70
70
|
|
71
71
|
if instance.reader_class.nil?
|
@@ -211,7 +211,13 @@ module EntityStore
|
|
211
211
|
end
|
212
212
|
|
213
213
|
module SnapshotMacro
|
214
|
-
def snapshot_macro(cls, interval)
|
214
|
+
def snapshot_macro(cls, int=nil, interval: nil)
|
215
|
+
interval ||= int
|
216
|
+
|
217
|
+
if interval.nil?
|
218
|
+
raise EntityStore::Error, "Snapshot interval must not be omitted"
|
219
|
+
end
|
220
|
+
|
215
221
|
define_method :snapshot_class do
|
216
222
|
cls
|
217
223
|
end
|
data/lib/loader.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
lib/entity_store.rb
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-entity_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.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:
|
11
|
+
date: 2018-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-entity_projection
|
@@ -74,6 +74,7 @@ files:
|
|
74
74
|
- lib/entity_store/entity_store.rb
|
75
75
|
- lib/entity_store/log.rb
|
76
76
|
- lib/entity_store/substitute.rb
|
77
|
+
- lib/loader.rb
|
77
78
|
homepage: https://github.com/eventide-project/entity-store
|
78
79
|
licenses:
|
79
80
|
- MIT
|
@@ -94,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
95
|
version: '0'
|
95
96
|
requirements: []
|
96
97
|
rubyforge_project:
|
97
|
-
rubygems_version: 2.
|
98
|
+
rubygems_version: 2.7.3
|
98
99
|
signing_key:
|
99
100
|
specification_version: 4
|
100
101
|
summary: Store of entities that are projected from streams
|