Class: AchClient::Logging::LogProviderJob

Inherits:
Object
  • Object
show all
Includes:
SuckerPunch::Job
Defined in:
lib/ach_client/logging/log_provider_job.rb

Overview

Worker to asynchronously invoke the log provider

Instance Method Summary collapse

Instance Method Details

#perform(body:, name:) ⇒ Object

Prettifies the xml and sends it asynchronously to the log provider

Parameters:

  • xml (String)

    xml body to log

  • name (String)

    title for the log



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ach_client/logging/log_provider_job.rb', line 10

def perform(body:, name:)
  # Savon logger does a nice job of XML pretty print
  # Takes: message, list of filters, pretty print boolean
  AchClient::Logging.log_provider.send_logs(
    body: maybe_encrypt_message(
      message: Savon::LogMessage.new(
        body,
        AchClient::Logging.log_filters,
        true
      ).to_s
    ),
    name: name
  )
end