Class: Appsignal::Hooks::DelayedJobHook

Inherits:
Hook
  • Object
show all
Defined in:
lib/appsignal/hooks/delayed_job.rb

Instance Method Summary collapse

Methods inherited from Hook

#installed?, register, #try_to_install

Instance Method Details

#dependencies_present?Boolean

Returns:

  • (Boolean)

6
7
8
# File 'lib/appsignal/hooks/delayed_job.rb', line 6

def dependencies_present?
  defined?(::Delayed::Plugin)
end

#installObject


10
11
12
13
14
15
# File 'lib/appsignal/hooks/delayed_job.rb', line 10

def install
  # The DJ plugin is a subclass of Delayed::Plugin, so we can only
  # require this code if we're actually installing.
  require 'appsignal/integrations/delayed_job_plugin'
  ::Delayed::Worker.plugins << Appsignal::Hooks::DelayedJobPlugin
end