Sha256: c140f08cde40a2c4fe519318b217bfeaa2b1f65f0ab903ddd6722cf21b2857de

Contents?: true

Size: 430 Bytes

Versions: 13

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

13 entries across 13 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-6.0.25 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.24 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.23 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.22 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.21 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.20 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.16 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.19 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.13 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.12 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.11 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.10 lib/sidekiq_unique_jobs/normalizer.rb
sidekiq-unique-jobs-6.0.9 lib/sidekiq_unique_jobs/normalizer.rb