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
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/activejob-7.1.3.4/lib/active_job/serializers/module_serializer.rb
activejob-8.0.1 lib/active_job/serializers/module_serializer.rb
activejob-8.0.0.1 lib/active_job/serializers/module_serializer.rb
activejob-7.2.2.1 lib/active_job/serializers/module_serializer.rb
activejob-7.1.5.1 lib/active_job/serializers/module_serializer.rb
activejob-7.0.8.7 lib/active_job/serializers/module_serializer.rb
activejob-8.0.0 lib/active_job/serializers/module_serializer.rb
activejob-7.2.2 lib/active_job/serializers/module_serializer.rb
activejob-7.1.5 lib/active_job/serializers/module_serializer.rb
activejob-8.0.0.rc2 lib/active_job/serializers/module_serializer.rb
activejob-7.2.1.2 lib/active_job/serializers/module_serializer.rb
activejob-7.1.4.2 lib/active_job/serializers/module_serializer.rb
activejob-7.0.8.6 lib/active_job/serializers/module_serializer.rb
activejob-8.0.0.rc1 lib/active_job/serializers/module_serializer.rb
activejob-7.2.1.1 lib/active_job/serializers/module_serializer.rb
activejob-7.1.4.1 lib/active_job/serializers/module_serializer.rb
activejob-7.0.8.5 lib/active_job/serializers/module_serializer.rb
activejob-8.0.0.beta1 lib/active_job/serializers/module_serializer.rb
omg-activejob-8.0.0.alpha9 lib/active_job/serializers/module_serializer.rb
omg-activejob-8.0.0.alpha8 lib/active_job/serializers/module_serializer.rb