evt-messaging 2.7.0.0 → 2.7.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/messaging/handle.rb +11 -8
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d22a40f19386098d8d266f77e69a6c794324d30f018e96a4993eab0c5cfc20e1
4
- data.tar.gz: 8d523d0b69b432eed9e06e8e24731a77f14809fd86df46aed900feb90b2d4e9c
3
+ metadata.gz: 9c8945f49315d73d29f7c3a3fa6d88bfca5c8eeb2dcd8fd5e34f2b5020881ef4
4
+ data.tar.gz: 77bfd0a23528e8624e74ca29a0a590892ce29d64571a9e75aeca7ed5247def60
5
5
  SHA512:
6
- metadata.gz: ea96206a951ad33ef9b7e7d52db38e9f9584adaa66d898cf77579608e16ebff7b597017d770bf143048809b964d3dd5d90da4bef7ab262516506ab0cfc53881c
7
- data.tar.gz: 8655511a3ae29570de973f79b5cfd535be9f701fdd6c2a7625fb4e9f746315bcb377b35c560c18563e482af2f53096b2215dcca79956361c48e868f65d6e98c0
6
+ metadata.gz: dbf96b8c14e18786fec12e942b075276b31ded1b1d1c1b7a9e062564d7923f8dbc4e5e1884d7bb935bed784a57f58c2c8bed7e752265643c12f9b462e685d095
7
+ data.tar.gz: 8b5ca6436050e0938f58bf081a8369f6fadb5181aed72875b0a0b3c3fa2decc8042336fcb396a175e77f016a56bdd3e70bc2f767f4e518b2274cb197c6e9621d
@@ -86,20 +86,20 @@ module Messaging
86
86
  extend self
87
87
 
88
88
  def handler(message_or_message_data)
89
- name = handler_name(message_or_message_data)
89
+ handler_method_name = handler_method_name(message_or_message_data)
90
90
 
91
- if method_defined?(name)
92
- return name
91
+ if method_defined?(handler_method_name)
92
+ return handler_method_name
93
93
  else
94
94
  return nil
95
95
  end
96
96
  end
97
97
 
98
98
  def handles?(message_or_message_data)
99
- method_defined? handler_name(message_or_message_data)
99
+ method_defined? handler_method_name(message_or_message_data)
100
100
  end
101
101
 
102
- def handler_name(message_or_message_data)
102
+ def handler_method_name(message_or_message_data)
103
103
  name = nil
104
104
 
105
105
  if message_or_message_data.is_a? MessageStore::MessageData::Read
@@ -110,7 +110,7 @@ module Messaging
110
110
  name = message_or_message_data.message_name
111
111
  end
112
112
 
113
- "handle_#{name}"
113
+ "handle_#{name}".to_sym
114
114
  end
115
115
  end
116
116
 
@@ -122,13 +122,16 @@ module Messaging
122
122
  end
123
123
 
124
124
  def handle_macro(message_class, &blk)
125
- define_handler_method(message_class, &blk)
125
+ handler_method_name = define_handler_method(message_class, &blk)
126
+
126
127
  message_registry.register(message_class)
128
+
129
+ handler_method_name
127
130
  end
128
131
  alias :handle :handle_macro
129
132
 
130
133
  def define_handler_method(message_class, &blk)
131
- handler_method_name = handler_name(message_class)
134
+ handler_method_name = handler_method_name(message_class)
132
135
 
133
136
  if blk.nil?
134
137
  error_msg = "Handler for #{message_class.name} is not correctly defined. It must have a block."
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: 2.7.0.0
4
+ version: 2.7.0.1
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: 2021-04-29 00:00:00.000000000 Z
11
+ date: 2022-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-message_store
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.1.2
111
+ rubygems_version: 3.3.3
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Common primitives for platform-specific messaging implementations for Eventide