icalia-sdk-event-notification 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0881a916a5b40c805d4c76fb40d420a0503623a10c89a79b0ad4d7b40bf788cb'
|
4
|
+
data.tar.gz: c577623065c6c3b9ce0ad4a75a87343d5126729a51cf8e1ae2830ad1f68caa71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40f24ef0826ecbbe9d40320b3c32f697d61430aeb13ad3da0d99e3d1fd4fa2eea88bee35d92f9d2988193e861b5620c9bb70371ac04d159004284c449ce77d77
|
7
|
+
data.tar.gz: 81bbe1d743b14b4d21291fc395a24538563fbdd97cf10c63616f321492e1b5088485e3c05e5f703b4c20469499915228e6137d21dd3ec64bb70c5381870f6a7f
|
@@ -9,6 +9,9 @@ module Icalia::Event::Shoryuken
|
|
9
9
|
|
10
10
|
delegate :logger, to: Shoryuken
|
11
11
|
|
12
|
+
# By default, process all notifications:
|
13
|
+
def process_notification?(notification); true; end
|
14
|
+
|
12
15
|
def perform(_sqs_msg, raw_notification)
|
13
16
|
notification = Icalia::Event::Notification.new raw_notification
|
14
17
|
|
@@ -23,10 +26,7 @@ module Icalia::Event::Shoryuken
|
|
23
26
|
send "process_#{action_name.underscore}".to_sym, notification
|
24
27
|
end
|
25
28
|
|
26
|
-
delegate :
|
27
|
-
:process_notification?,
|
28
|
-
:define_noop_action_processor,
|
29
|
-
to: :class
|
29
|
+
delegate :define_noop_action_processor, to: :class
|
30
30
|
|
31
31
|
class ActionProcessorPatternTest
|
32
32
|
attr_reader :action_name
|
@@ -40,26 +40,24 @@ module Icalia::Event::Shoryuken
|
|
40
40
|
def match?; @action_name != nil; end
|
41
41
|
end
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
else
|
50
|
-
super
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def define_noop_action_processor(action_processor_method, action_name)
|
55
|
-
define_singleton_method action_processor_method do |*args|
|
56
|
-
logger.info "#{name} does not know how to process #{action_name}" \
|
57
|
-
" - Ignoring message"
|
58
|
-
end
|
59
|
-
delegate action_processor_method, to: :class
|
43
|
+
def method_missing(method_sym, *arguments, &block)
|
44
|
+
processor_test = ActionProcessorPatternTest.new(method_sym)
|
45
|
+
|
46
|
+
if processor_test.match?
|
47
|
+
define_noop_action_processor(method_sym, processor_test.action_name)
|
48
|
+
return send(method_sym, *arguments)
|
60
49
|
end
|
61
50
|
|
62
|
-
|
51
|
+
super
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.define_noop_action_processor(action_processor_method, action_name)
|
55
|
+
return if method_defined? action_processor_method
|
56
|
+
|
57
|
+
define_method action_processor_method do |*args|
|
58
|
+
logger.info "#{self.class.name} does not know how to process " \
|
59
|
+
"#{action_name} - Ignoring message"
|
60
|
+
end
|
63
61
|
end
|
64
62
|
end
|
65
63
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: icalia-sdk-event-notification
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Quintanilla
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1.
|
19
|
+
version: 0.1.6
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.1.
|
26
|
+
version: 0.1.6
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|