lib/dispatch-rider/callbacks/storage.rb in dispatch-rider-2.1.0 vs lib/dispatch-rider/callbacks/storage.rb in dispatch-rider-2.2.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module DispatchRider
module Callbacks
# Storage for callbacks.
class Storage
def initialize
@@ -19,14 +21,14 @@
# @param [Symbol] event name of the event
# @param [#call] block_param block passed as a parameter
# @param [Proc] &block
def after(event, block_param = nil, &block)
around(event) do |job, *args|
- begin
- job.call
- ensure
- (block_param || block).call(*args)
- end
+
+ job.call
+ ensure
+ (block_param || block).call(*args)
+
end
end
# @param [Symbol] event name of the event
# @param [#call] block_param block passed as a parameter