SumOfUs/Champaign

View on GitHub
app/lib/payment_processor/go_cardless/webhook_handler/processable.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module PaymentProcessor
  module GoCardless
    module WebhookHandler
      module Processable
        def initialize(event)
          @event = event
        end

        def process
          return unless action && record.try("may_run_#{action}?")

          record.send("run_#{action}!", @event)
        end
      end
    end
  end
end