ruby_event_store 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/ruby_event_store/event.rb +6 -5
- data/lib/ruby_event_store/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69546ce0878a7fa65749f566b540daa5c95208d2
|
4
|
+
data.tar.gz: d61f323dfcf883a093c30fb0c4fb38bdfb83efe5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7c10b9e99f4bfa6ceb29851f712defbe399219977e221770acd72e5f0669d0095cb51d9ae618933dcc6c92e0d1b2ba8a79dd0e6e95911441c35a5177a85d100
|
7
|
+
data.tar.gz: c00e2dc24868728c5c1fbd468a11eb446e5c63ab70187f24274b8ea6485082e0ed0ebf50809244e2e0572d644310b91df89783f41d19ff97e03598970313a9cc
|
data/CHANGELOG.md
CHANGED
@@ -10,8 +10,9 @@ module RubyEventStore
|
|
10
10
|
|
11
11
|
@event_type = args[:event_type] || event_name
|
12
12
|
@event_id = (args[:event_id] || generate_id).to_s
|
13
|
-
@metadata =
|
13
|
+
@metadata = args[:metadata] || {}
|
14
14
|
@data = attributes(args)
|
15
|
+
@metadata[:timestamp] ||= Time.now.utc
|
15
16
|
end
|
16
17
|
attr_reader :event_type, :event_id, :metadata, :data
|
17
18
|
|
@@ -24,16 +25,16 @@ module RubyEventStore
|
|
24
25
|
}
|
25
26
|
end
|
26
27
|
|
28
|
+
def timestamp
|
29
|
+
metadata[:timestamp]
|
30
|
+
end
|
31
|
+
|
27
32
|
private
|
28
33
|
|
29
34
|
def attributes(args)
|
30
35
|
args.reject { |k| [:event_type, :event_id, :metadata].include? k }
|
31
36
|
end
|
32
37
|
|
33
|
-
def timestamp
|
34
|
-
{ timestamp: Time.now.utc }
|
35
|
-
end
|
36
|
-
|
37
38
|
def generate_id
|
38
39
|
SecureRandom.uuid
|
39
40
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_event_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rybex
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-03-
|
12
|
+
date: 2016-03-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|