lib/rocket_job/subscriber.rb in rocketjob-5.1.1 vs lib/rocket_job/subscriber.rb in rocketjob-5.2.0.beta1
- old
+ new
@@ -1,6 +1,6 @@
-require 'active_support/concern'
+require "active_support/concern"
module RocketJob
# Mix-in to publish and subscribe to events.
#
# Example:
@@ -64,15 +64,15 @@
unless public_methods.include?(action)
logger.warn("Ignoring unknown action: #{action}")
return
end
- args = (method(action).arity == 0) || parameters.nil? ? nil : parameters.symbolize_keys
+ args = method(action).arity.zero? || parameters.nil? ? nil : parameters.symbolize_keys
args ? public_send(action, **args) : public_send(action)
- rescue ArgumentError => exc
- logger.error("##{action}: Invalid Arguments. Resuming..", exc)
- rescue StandardError => exc
- logger.error("##{action}: Exception caught. Resuming..", exc)
+ rescue ArgumentError => e
+ logger.error("##{action}: Invalid Arguments. Resuming..", e)
+ rescue StandardError => e
+ logger.error("##{action}: Exception caught. Resuming..", e)
end
def process_event(name, action, parameters)
raise(NotImplementedError)
end