evt-messaging 0.16.0.2 → 0.17.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
  SHA1:
3
- metadata.gz: 2633d42fd03addf1db9388a55cbead70484f75f0
4
- data.tar.gz: b2fb5ffdca9693af05be1d42dbbca1497274a7cc
3
+ metadata.gz: c8619b84bbda166bf4b0243fc0cc22829046dde4
4
+ data.tar.gz: b66c11f2750beb67cf78b5e4f99f37d45daf9315
5
5
  SHA512:
6
- metadata.gz: a76d80eba4d78d0b79451685c2b124fb044d76015a73d72016d25f329245047135f93430b0c0fe6abd94eca9835f4c9cdbce0b0d77cc38fb67ab300c4af71541
7
- data.tar.gz: 8293dc668a6d5345a87b36b9f66ba739126a8fe6b51e01f5394b55cb65bb497a74c8c657b6a50fa299de373845007a4e2f30f0d806f36ffb2589be8743f551bd
6
+ metadata.gz: 68c8c847aca573b282de33dc17b3339ec8c0e662f46a4f85050d9555a34ae0c870896b37148c438675cc799229c57f2393dc439bce5933f6f860aa6111c7cc4e
7
+ data.tar.gz: 84b7f26a3128eeb9282a2972aeb4ea668ae60e613fec7e41888e6cdf45c3645f5a2563e4e34a55fa19969e1766c2f27f02cf4fb425e5b4349c23b47a826c089c
@@ -42,6 +42,10 @@ module Messaging
42
42
  class_name(msg).split('::').last
43
43
  end
44
44
 
45
+ def message_type?(type)
46
+ message_type == type
47
+ end
48
+
45
49
  def message_name(msg=self)
46
50
  Info.canonize_name(message_type(msg))
47
51
  end
@@ -1,7 +1,11 @@
1
1
  module Messaging
2
2
  module Message
3
3
  module Import
4
+ Error = Class.new(RuntimeError)
5
+
4
6
  def self.call(message_data, message_class)
7
+ raise Error unless message_class.message_type?(message_data.type)
8
+
5
9
  Transform::Read.(message_data, :message_data, message_class)
6
10
  end
7
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evt-messaging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0.2
4
+ version: 0.17.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Eventide Project