Sha256: 374f6a99e9689d8c47d0d9536c26d555afae11cd42360c5402bf6617442affb5

Contents?: true

Size: 463 Bytes

Versions: 78

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

78 entries across 75 versions & 8 rubygems

Version Path
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/activejob-7.0.3.1/lib/active_job/serializers/module_serializer.rb
activejob-7.0.5 lib/active_job/serializers/module_serializer.rb
activejob-7.0.4.3 lib/active_job/serializers/module_serializer.rb
activejob-7.0.4.2 lib/active_job/serializers/module_serializer.rb
activejob-7.0.4.1 lib/active_job/serializers/module_serializer.rb
activejob-7.0.4 lib/active_job/serializers/module_serializer.rb
activejob-7.0.3.1 lib/active_job/serializers/module_serializer.rb
activejob-7.0.3 lib/active_job/serializers/module_serializer.rb
activejob-7.0.2.4 lib/active_job/serializers/module_serializer.rb
activejob-7.0.2.3 lib/active_job/serializers/module_serializer.rb
activejob-7.0.2.2 lib/active_job/serializers/module_serializer.rb
activejob-7.0.2.1 lib/active_job/serializers/module_serializer.rb
activejob-7.0.2 lib/active_job/serializers/module_serializer.rb
activejob-7.0.1 lib/active_job/serializers/module_serializer.rb
activejob-7.0.0 lib/active_job/serializers/module_serializer.rb
activejob-7.0.0.rc3 lib/active_job/serializers/module_serializer.rb
activejob-7.0.0.rc2 lib/active_job/serializers/module_serializer.rb
activejob-7.0.0.rc1 lib/active_job/serializers/module_serializer.rb