Module: Exekutor::Hook
- Extended by:
- ActiveSupport::Concern
- Included in:
- Plugins::Appsignal
- Defined in:
- lib/exekutor/hook.rb
Overview
Defines hooks for Exekutor.
Instance Method Summary collapse
-
#callbacks ⇒ Hash<Symbol,Array<Proc>>
Gets the registered callbacks.
Instance Method Details
#callbacks ⇒ Hash<Symbol,Array<Proc>>
Gets the registered callbacks
40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/exekutor/hook.rb', line 40 def callbacks instance = self __callbacks.transform_values do |callbacks| callbacks.map do |method, callback| if method method(method) elsif callback.arity.zero? -> { instance.instance_exec(&callback) } else ->(*args) { instance.instance_exec(*args, &callback) } end end end end |