Class: Appsignal::Hooks::Hook Private
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Direct Known Subclasses
ActionCableHook, ActiveSupportNotificationsHook, CelluloidHook, DataMapperHook, DelayedJobHook, MongoRubyDriverHook, NetHttpHook, PassengerHook, PumaHook, RakeHook, RedisHook, SequelHook, ShoryukenHook, SidekiqHook, UnicornHook, WebmachineHook
Class Method Summary collapse
Instance Method Summary collapse
- #dependencies_present? ⇒ Boolean private
-
#initialize ⇒ Hook
constructor
private
A new instance of Hook.
- #install ⇒ Object private
- #installed? ⇒ Boolean private
- #try_to_install(name) ⇒ Object private
Constructor Details
#initialize ⇒ Hook
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Hook.
25 26 27 |
# File 'lib/appsignal/hooks.rb', line 25 def initialize @installed = false end |
Class Method Details
.register(name, hook = self) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 |
# File 'lib/appsignal/hooks.rb', line 21 def self.register(name, hook = self) Appsignal::Hooks.register(name, hook.new) end |
Instance Method Details
#dependencies_present? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
45 46 47 |
# File 'lib/appsignal/hooks.rb', line 45 def dependencies_present? raise NotImplementedError end |
#install ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
49 50 51 |
# File 'lib/appsignal/hooks.rb', line 49 def install raise NotImplementedError end |
#installed? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 |
# File 'lib/appsignal/hooks.rb', line 41 def installed? @installed end |
#try_to_install(name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/appsignal/hooks.rb', line 29 def try_to_install(name) if dependencies_present? && !installed? Appsignal.logger.info("Installing #{name} hook") begin install @installed = true rescue => ex Appsignal.logger.error("Error while installing #{name} hook: #{ex}") end end end |