Class: Gruf::Hooks::Executor
- Inherits:
-
Object
- Object
- Gruf::Hooks::Executor
- Includes:
- Loggable
- Defined in:
- lib/gruf/hooks/executor.rb
Overview
Base class for a hook that allows execution at various points of gRPC server processes
Instance Method Summary collapse
-
#call(name, arguments = {}) ⇒ Object
Execute a hook point for each registered hook in the registry.
-
#initialize(hooks: nil) ⇒ Executor
constructor
A new instance of Executor.
Methods included from Loggable
Constructor Details
Instance Method Details
#call(name, arguments = {}) ⇒ Object
Execute a hook point for each registered hook in the registry
36 37 38 39 40 41 42 43 44 |
# File 'lib/gruf/hooks/executor.rb', line 36 def call(name, arguments = {}) name = name.to_sym @hooks.each do |hook| next unless hook.respond_to?(name) hook.send(name, **arguments) end end |