Module: Axn::Webhooks::Outbound

Defined in:
lib/axn/webhooks/outbound.rb,
lib/axn/webhooks/outbound/dsl.rb,
lib/axn/webhooks/outbound/emit.rb,
lib/axn/webhooks/outbound/config.rb,
lib/axn/webhooks/outbound/signer.rb,
lib/axn/webhooks/outbound/deliver.rb,
lib/axn/webhooks/outbound/envelope.rb,
lib/axn/webhooks/outbound/transport.rb,
lib/axn/webhooks/outbound/subscriber.rb,
lib/axn/webhooks/outbound/target_policy.rb,
lib/axn/webhooks/outbound/callable_arity.rb

Overview

Process-global registration for outbound webhook emission (a single outbound block).

Defined Under Namespace

Modules: CallableArity, Envelope, Signer, TargetPolicy, Transport Classes: Config, DSL, Deliver, Emit, Subscriber

Class Method Summary collapse

Class Method Details

.configObject



40
41
42
# File 'lib/axn/webhooks/outbound.rb', line 40

def config
  @config || raise(Axn::Webhooks::Error, "no `outbound` block declared — call Axn::Webhooks.outbound { … } at boot")
end

.install(config) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/axn/webhooks/outbound.rb', line 26

def install(config)
  @mutex.synchronize do
    unless @config.nil?
      Axn.config.logger.warn(
        "[axn-webhooks] a second `Axn::Webhooks.outbound` block replaces the first — only one outbound declaration is active at a time",
      )
    end

    @config = config
  end
end

.reset!Object



38
# File 'lib/axn/webhooks/outbound.rb', line 38

def reset! = @mutex.synchronize { @config = nil }