File: plugin.rb

package info (click to toggle)
ruby-delayed-job 4.1.13-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 372 kB
  • sloc: ruby: 2,650; makefile: 8
file content (15 lines) | stat: -rw-r--r-- 322 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'active_support/core_ext/class/attribute'

module Delayed
  class Plugin
    class_attribute :callback_block

    def self.callbacks(&block)
      self.callback_block = block
    end

    def initialize
      self.class.callback_block.call(Delayed::Worker.lifecycle) if self.class.callback_block
    end
  end
end