Sha256: 4a85644c2a9715545806785e06eb809e2d88dc5c9b9eef268e5e31501079e045
Contents?: true
Size: 634 Bytes
Versions: 14
Compression:
Stored size: 634 Bytes
Contents
# frozen_string_literal: true require "active_job/serializers/object_serializer" # :nocov: module AcidicJob module Serializers class WorkerSerializer < ::ActiveJob::Serializers::ObjectSerializer def serialize(worker) super( "job_class" => worker.class.name, "arguments" => worker.arguments, ) end def deserialize(hash) worker_class = hash["job_class"].constantize worker_class.new(*hash["arguments"]) end def serialize?(argument) defined?(::Sidekiq) && argument.class.include?(::Sidekiq::Worker) end end end end # :nocov:
Version data entries
14 entries across 14 versions & 1 rubygems