Class: Axn::Webhooks::Respond

Inherits:
Object
  • Object
show all
Includes:
Axn, VendorFacet
Defined in:
lib/axn/webhooks/respond.rb

Overview

The respond stage as an Axn: runs the endpoint's custom respond block against the handler's result to build a Response. Built as an Axn so a raise inside the (user-supplied) respond block — e.g. reading an exposure the handler forgot to set — is reported once via on_exception and mapped to a 500 by Endpoint#to_response, never an unhandled exception escaping the HTTP mapper.

Instance Method Summary collapse

Methods included from VendorFacet

included

Instance Method Details

#callObject



21
22
23
# File 'lib/axn/webhooks/respond.rb', line 21

def call
  expose response: Inbound::RespondContext.new.instance_exec(handler_result, &responder)
end