evt-messaging 0.7.1.2 → 0.7.2.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
  SHA1:
3
- metadata.gz: 4e081765963db390644aa256ec650ca8e0791818
4
- data.tar.gz: a33b41832cb9947e2b54eb53662471f527ccb164
3
+ metadata.gz: 2b5f215ee70f13d31e0cd89748506ee5fa296fff
4
+ data.tar.gz: 9a65f4ef8c195dd86da18418f49a3d2db6b740a6
5
5
  SHA512:
6
- metadata.gz: 99c8892b80a4419a417cdcc4f311ec6cff9fc309419a33c3583b91227f5a1e341294a527a6db64a33fb4f492e21430a2babbee9938685cb76e2b46302709150f
7
- data.tar.gz: d4b9ecc617f231eda41b58a1959982cc848b56cb1c2b34ea7619d8a9018c9b8d4b2c68cd444e2c609cb96ae839ae91b8d6d55fe0fe8be763002ceb503c6f3a51
6
+ metadata.gz: c8a8c440f026ae4edb5229e307c98b91f07f0760c049ae390b71ae6aa0ca0d1d2271f1f94a7a624a3421bb13d93308f2cedd3c4341e0719b3081cb2be84ae518
7
+ data.tar.gz: 91e082480082bad761f9ec16dab83478e06f6e4ff287669e64a36cd8a60a536b80e9615ce031ab6b61b77103aced4996869efd3ff271a204b3619037c8c7eb02
@@ -2,6 +2,7 @@ require 'clock/controls'
2
2
  require 'event_source/controls'
3
3
 
4
4
  require 'messaging/controls/time'
5
+ require 'messaging/controls/id'
5
6
  require 'messaging/controls/stream'
6
7
  require 'messaging/controls/stream_name'
7
8
  require 'messaging/controls/event_data'
@@ -0,0 +1,5 @@
1
+ module Messaging
2
+ module Controls
3
+ ID = EventSource::Controls::ID
4
+ end
5
+ end
@@ -6,6 +6,7 @@ module Messaging
6
6
  metadata ||= Controls::Metadata.example
7
7
 
8
8
  message = SomeMessage.new
9
+ message.id = id
9
10
  message.some_attribute = some_attribute
10
11
  message.other_attribute = other_attribute
11
12
 
@@ -44,6 +45,10 @@ module Messaging
44
45
  SomeMessage
45
46
  end
46
47
 
48
+ def self.id
49
+ ID::Random.example
50
+ end
51
+
47
52
  def self.type
48
53
  'SomeMessage'
49
54
  end
@@ -5,6 +5,7 @@ module Messaging
5
5
  include Schema::DataStructure
6
6
  end
7
7
 
8
+ ## TODO put this in the included block, and remove the cls.
8
9
  cls.extend Info
9
10
  cls.extend Build
10
11
  cls.extend Copy
@@ -12,6 +13,8 @@ module Messaging
12
13
  cls.extend Transformer
13
14
  end
14
15
 
16
+ attr_accessor :id
17
+
15
18
  attr_writer :metadata
16
19
  def metadata
17
20
  @metadata ||= Metadata.new
@@ -10,13 +10,16 @@ module Messaging
10
10
  end
11
11
 
12
12
  def self.instance(event_data_data, cls)
13
- cls.build(event_data_data[:data], event_data_data[:metadata])
13
+ instance = cls.build(event_data_data[:data], event_data_data[:metadata])
14
+ instance.id = event_data_data[:id]
15
+ instance
14
16
  end
15
17
 
16
18
  module EventData
17
19
  def self.write(message)
18
20
  event_data = EventSource::EventData::Write.build
19
21
 
22
+ event_data.id = message.id
20
23
  event_data.type = message.message_type
21
24
 
22
25
  event_data.data = message.to_h
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evt-messaging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1.2
4
+ version: 0.7.2.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: 2016-12-20 00:00:00.000000000 Z
11
+ date: 2017-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-event_source
@@ -50,6 +50,7 @@ files:
50
50
  - lib/messaging/controls/batch.rb
51
51
  - lib/messaging/controls/event_data.rb
52
52
  - lib/messaging/controls/handler.rb
53
+ - lib/messaging/controls/id.rb
53
54
  - lib/messaging/controls/message.rb
54
55
  - lib/messaging/controls/metadata.rb
55
56
  - lib/messaging/controls/stream.rb