evt-entity_store 0.5.5.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
  SHA256:
3
- metadata.gz: 31a6a5ae66085b4e9d9cbf5e79dd0af060fe4420bc497296c736fc704a607a4c
4
- data.tar.gz: f40b7cc743e4c0ef1c3e217bf5555242a57c47a644d28349581480976210d8c1
3
+ metadata.gz: 3a239b36fff9609864161b87827e626161383681a15fda4222cba315385a761b
4
+ data.tar.gz: f3a4357cbf10a7783a7a47118b5d2a8ccd917d8569f43cb998c3f307ed22eaf0
5
5
  SHA512:
6
- metadata.gz: ff85f7ecb466da7ce93ddb681902421296157caf2bee4ece5ddebdf23ce302f9da39aa37b8ca6ff4ca36958b9b76ab698b40cdf63b5aea8e22bc0992a4505a7f
7
- data.tar.gz: 8379a4eeb664a62c0de4d735556e98989701c4f43a6f2df7229c3f9da4dd7db274b5f356728f75cacbdb7a4c18d37849f1021f7e1f4f9a095cdc096c5a7defc3
6
+ metadata.gz: 5dd63bd50a2993fa857b2a687d60a3a6ef5076d15ec87f8858c77ba9203c05f4cc99ad14503bf7836ac1e27fc25df208314bb68f2243ff4a03b1c0879d0b3655
7
+ data.tar.gz: 78b38c29fef66825201a238ecd59ff689624b6ea79fe36454b83ed6d80939f2a1cb93891706dc13f21414deb1108ee616dafc67baf1f090c6a0d8be72e6a192a
@@ -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, snapshot_interval_keyword: nil, reader_batch_size: nil)
5
- if category.nil? && entity_class.nil? && projection_class.nil? && reader_class.nil? && snapshot_class.nil? && snapshot_interval.nil? && snapshot_interval_keyword.nil? && reader_batch_size.nil?
4
+ def self.example(category: nil, entity_class: nil, projection_class: nil, reader_class: nil, snapshot_class: nil, snapshot_interval: nil, reader_batch_size: nil)
5
+ if category.nil? && entity_class.nil? && projection_class.nil? && reader_class.nil? && snapshot_class.nil? && snapshot_interval.nil? && reader_batch_size.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, snapshot_interval_keyword: snapshot_interval_keyword, reader_batch_size: reader_batch_size)
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, reader_batch_size: reader_batch_size)
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, snapshot_interval_keyword: nil, reader_batch_size: nil)
15
+ def self.example_class(category: nil, entity_class: nil, projection_class: nil, reader_class: nil, snapshot_class: nil, snapshot_interval: nil, reader_batch_size: nil)
16
16
  if category == :none
17
17
  category = nil
18
18
  else
@@ -52,22 +52,18 @@ module EntityStore
52
52
  reader reader_class, batch_size: reader_batch_size
53
53
 
54
54
  unless snapshot_class.nil?
55
- if snapshot_interval_keyword.nil?
56
- snapshot snapshot_class, snapshot_interval
57
- else
58
- snapshot snapshot_class, interval: snapshot_interval_keyword
59
- end
55
+ snapshot snapshot_class, interval: snapshot_interval
60
56
  end
61
57
  end
62
58
  end
63
59
 
60
+ Example = self.example_class
61
+
64
62
  module Category
65
63
  def self.example
66
64
  :some_category
67
65
  end
68
66
  end
69
-
70
- Example = self.example_class
71
67
  end
72
68
  end
73
69
  end
@@ -1,7 +1,34 @@
1
1
  module EntityStore
2
2
  module Controls
3
+ Snapshot = EntityCache::Controls::Store::External
4
+
3
5
  module Snapshot
4
- Example = EntityCache::Controls::Store::External::Example
6
+ module Assurance
7
+ Error = EntityCache::Store::External::Error
8
+
9
+ module Assured
10
+ class Example
11
+ def self.assure(store); end
12
+ def self.configure(*); end
13
+ end
14
+ end
15
+
16
+ module NotAssured
17
+ class Example
18
+ def self.assure(store)
19
+ raise Error
20
+ end
21
+
22
+ def self.configure(*); end
23
+ end
24
+ end
25
+
26
+ module NotImplemented
27
+ class Example
28
+ def self.configure(*); end
29
+ end
30
+ end
31
+ end
5
32
  end
6
33
  end
7
34
  end
@@ -76,6 +76,13 @@ module EntityStore
76
76
  if instance.reader_class.nil?
77
77
  raise Error, "Reader is not declared"
78
78
  end
79
+
80
+ snapshot_class = instance.snapshot_class
81
+ unless snapshot_class.nil?
82
+ if snapshot_class.respond_to?(:assure)
83
+ snapshot_class.assure(instance)
84
+ end
85
+ end
79
86
  end
80
87
  end
81
88
 
@@ -224,13 +231,7 @@ module EntityStore
224
231
  end
225
232
 
226
233
  module SnapshotMacro
227
- def snapshot_macro(cls, int=nil, interval: nil)
228
- interval ||= int
229
-
230
- if interval.nil?
231
- raise EntityStore::Error, "Snapshot interval must not be omitted"
232
- end
233
-
234
+ def snapshot_macro(cls, interval: nil)
234
235
  define_method :snapshot_class do
235
236
  cls
236
237
  end
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.5.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: 2018-10-24 00:00:00.000000000 Z
11
+ date: 2018-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-entity_projection