Module: Julewire::Core::Integration::BeforeForkHooks

Defined in:
lib/julewire/core/integration/before_fork_hooks.rb

Class Method Summary collapse

Class Method Details

.register(integration, component:, &callback) ⇒ Object

Raises:

  • (ArgumentError)


12
13
14
15
16
17
18
# File 'lib/julewire/core/integration/before_fork_hooks.rb', line 12

def register(integration, component:, &callback)
  raise ArgumentError, "block required" unless callback

  HookNames.validate!(integration, name: :integration)
  HookNames.validate!(component, name: :component)
  entries[[integration, component]] = callback
end

.runObject



20
21
22
23
# File 'lib/julewire/core/integration/before_fork_hooks.rb', line 20

def run
  entries.each_value(&:call)
  nil
end