sidekiq-eventbus 0.0.5 → 0.0.6

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: b07d3cbd633ccb68fff5975cecbae3dae4b7b629
4
- data.tar.gz: 337a6cc7e3e74b4a9017688ad8b5bbc57fb96e72
3
+ metadata.gz: 7061dd705796ed74b0ee5cf0728d269b06ac341e
4
+ data.tar.gz: 1f44778cbd38de46eb79f8e2f291da182d2f4f20
5
5
  SHA512:
6
- metadata.gz: 798b92159ba82596f5de181eaf4f7f6ab9d6c7990c0024e422646ceb5deca47df9f17ce948d76f8c6e1c8ec32bb23ea2f4150b6e6a1142f281f97bebc4c229b5
7
- data.tar.gz: d60a26981ebdc5e5dd32be0d23bfbb4e211c116e254466b51ba88e052137a627822457003060099a2be7443b460ce3bf8875bb5e9e6f6386acbcaefe6116c968
6
+ metadata.gz: b98e138821232d05837624b86c653de82af593d7678139a9071f91963760ea647f0447c11fbe3f8da08101406707edd0bbaa4b752c6471dfc1fd6cb35de900b4
7
+ data.tar.gz: aea550b45556040b2dee7d0dbd0c6a7baeb8626f45c6dcf962d370aca66549aad390295da83e0cc22323a7a8ac5ff2932ad8126fd87875e0b4d193b5719bd5b6
@@ -22,11 +22,16 @@ class Sidekiq::EventBus::Consumer
22
22
  end
23
23
  end
24
24
 
25
+ PAYLOAD_WITH_INDIFFERENT_ACCESS = defined?(ActiveSupport::HashWithIndifferentAccess)
25
26
 
26
27
  def consume topic, event, payload
27
28
  if self.class.handlers.key? event
28
29
  _payload = payload.merge('topic'.freeze => topic, 'event'.freeze => event).freeze
29
30
 
31
+ if PAYLOAD_WITH_INDIFFERENT_ACCESS
32
+ _payload = ActiveSupport::HashWithIndifferentAccess.new(_payload)
33
+ end
34
+
30
35
  self.class.handlers[event].each do |handler|
31
36
  begin
32
37
  if handler.is_a? Proc
@@ -40,4 +45,4 @@ class Sidekiq::EventBus::Consumer
40
45
  end
41
46
  end
42
47
  end
43
- end
48
+ end
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module EventBus
3
- VERSION = '0.0.5'
3
+ VERSION = '0.0.6'
4
4
  end
5
- end
5
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-eventbus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phil Monroe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-12 00:00:00.000000000 Z
11
+ date: 2017-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq