Sha256: cfa45ee23be4fca4bb86814d187b72a81a20578a25c80209bb3f2324a528c1bc

Contents?: true

Size: 430 Bytes

Versions: 11

Compression:

Stored size: 430 Bytes

Contents

# frozen_string_literal: true

require 'json'

module SidekiqUniqueJobs
  # Normalizes hashes by dumping them to json and loading them from json
  #
  # @author Mikael Henriksson <mikael@zoolutions.se>
  module Normalizer
    # Changes hash to a json compatible hash
    # @param [Hash] args
    # @return [Hash] a json compatible hash
    def self.jsonify(args)
      Sidekiq.load_json(Sidekiq.dump_json(args))
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-6.0.8 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.7 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.6 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.5 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.4 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.3 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.2 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.1 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.0 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.0.rc8 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.0.rc7 lib/sidekiq_unique_jobs/normalizer.rb