Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit de95b8d

Browse files
committed
Merge pull request #24 from codeclimate/pb-support-unit
Services no longer must support all possible events
2 parents f4ce2aa + a7f95d7 commit de95b8d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/cc/service.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,12 @@ def initialize(config, payload)
7979
end
8080

8181
def receive
82-
if respond_to?(:receive_event)
83-
receive_event
84-
else
85-
public_send("receive_#{event}")
82+
methods = [:receive_event, :"receive_#{event}"]
83+
84+
methods.each do |method|
85+
if respond_to?(method)
86+
return public_send(method)
87+
end
8688
end
8789
end
8890

0 commit comments

Comments
 (0)