Sha256: a90fdf00902a9bd5180f484fc162ef550a10f5c4213759a6ef8c4bd045f03e21

Contents?: true

Size: 310 Bytes

Versions: 4

Compression:

Stored size: 310 Bytes

Contents

module Tennis::Worker::Generic::BeforeHook
  def before(&block)
    if block_given?
      _before_hooks << block
    end
  end

  def _process_before_hooks(message, worker)
    _before_hooks.each do |hook|
      hook.call(message, worker)
    end
  end

  def _before_hooks
    @_before_hooks ||= []
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tennis-jobs-0.3.1 lib/tennis/worker/generic/before_hook.rb
tennis-jobs-0.3.0 lib/tennis/worker/generic/before_hook.rb
tennis-jobs-0.2.0 lib/tennis/worker/generic/before_hook.rb
tennis-jobs-0.1.0 lib/tennis/worker/generic/before_hook.rb