Sha256: 374f6a99e9689d8c47d0d9536c26d555afae11cd42360c5402bf6617442affb5

Contents?: true

Size: 463 Bytes

Versions: 77

Compression:

Stored size: 463 Bytes

Contents

# frozen_string_literal: true

module ActiveJob
  module Serializers
    class ModuleSerializer < ObjectSerializer # :nodoc:
      def serialize(constant)
        raise SerializationError, "Serializing an anonymous class is not supported" unless constant.name
        super("value" => constant.name)
      end

      def deserialize(hash)
        hash["value"].constantize
      end

      private
        def klass
          Module
        end
    end
  end
end

Version data entries

77 entries across 74 versions & 7 rubygems

Version Path
activejob-7.1.3.2 lib/active_job/serializers/module_serializer.rb
activejob-7.1.3.1 lib/active_job/serializers/module_serializer.rb
activejob-7.0.8.1 lib/active_job/serializers/module_serializer.rb
activejob-7.1.3 lib/active_job/serializers/module_serializer.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/activejob-7.0.2.3/lib/active_job/serializers/module_serializer.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/activejob-7.0.3.1/lib/active_job/serializers/module_serializer.rb
activejob-7.1.2 lib/active_job/serializers/module_serializer.rb
activejob-7.1.1 lib/active_job/serializers/module_serializer.rb
activejob-7.1.0 lib/active_job/serializers/module_serializer.rb
activejob-7.1.0.rc2 lib/active_job/serializers/module_serializer.rb
activejob-7.1.0.rc1 lib/active_job/serializers/module_serializer.rb
activejob-7.1.0.beta1 lib/active_job/serializers/module_serializer.rb
activejob-7.0.8 lib/active_job/serializers/module_serializer.rb
activejob-7.0.7.2 lib/active_job/serializers/module_serializer.rb
activejob-7.0.7.1 lib/active_job/serializers/module_serializer.rb
activejob-7.0.7 lib/active_job/serializers/module_serializer.rb
activejob-7.0.6 lib/active_job/serializers/module_serializer.rb
activejob-7.0.5.1 lib/active_job/serializers/module_serializer.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/activejob-7.0.2.3/lib/active_job/serializers/module_serializer.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/activejob-7.0.3.1/lib/active_job/serializers/module_serializer.rb