Method: Webhookdb::Replicator::Base#_resource_and_event
- Defined in:
- lib/webhookdb/replicator/base.rb
#_resource_and_event(request) ⇒ Array<Hash>?
This method is abstract.
Given a webhook/backfill item payload, return the resource hash, and an optional event hash. If ‘body’ is the resource itself, this method returns [body, nil]. If ‘body’ is an event, this method returns [body.resource-key, body]. Columns can check for whether there is an event and/or body when converting.
If this returns nil, the upsert is skipped.
For example, a Stripe customer backfill upsert would be ‘’cus_123’‘ when we backfill, but `’event’, data: {id: ‘cus_123’}‘ when handling an event.
796 797 798 |
# File 'lib/webhookdb/replicator/base.rb', line 796 def _resource_and_event(request) raise NotImplementedError end |