Sha256: f0b0387448a199146d1f40a8e775fc19a3e623c6fc3cae803e479e07d6646219

Contents?: true

Size: 713 Bytes

Versions: 4

Compression:

Stored size: 713 Bytes

Contents

# frozen_string_literal: true

module AcidicJob
  module PerformWrapper
    def perform(*args, **kwargs)
      # store arguments passed into `perform` so that we can later persist
      # them to `AcidicJob::Key#job_args` for both ActiveJob and Sidekiq::Worker
      @arguments_for_perform = if args.any? && kwargs.any?
                                 args + [kwargs]
                               elsif args.any? && kwargs.none?
                                 args
                               elsif args.none? && kwargs.any?
                                 [kwargs]
                               else
                                 []
                               end

      super
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
acidic_job-0.6.0 lib/acidic_job/perform_wrapper.rb
acidic_job-0.5.5 lib/acidic_job/perform_wrapper.rb
acidic_job-0.5.4 lib/acidic_job/perform_wrapper.rb
acidic_job-0.5.3 lib/acidic_job/perform_wrapper.rb