Sha256: 40e2e626518300b9cbe2e5c4e79f5fc78520e2c130f6bc77538a991dd4947797

Contents?: true

Size: 598 Bytes

Versions: 19

Compression:

Stored size: 598 Bytes

Contents

# frozen_string_literal: true

require "active_job/serializers/object_serializer"

module AcidicJob
  module Serializers
    class FinishedPointSerializer < ::ActiveJob::Serializers::ObjectSerializer
      def serialize(finished_point)
        super(
          "class" => finished_point.class.name
        )
      end

      def deserialize(hash)
        finished_point_class = hash["class"].constantize
        finished_point_class.new
      end

      def serialize?(argument)
        defined?(::AcidicJob::FinishedPoint) && argument.is_a?(::AcidicJob::FinishedPoint)
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
acidic_job-0.9.0 lib/acidic_job/serializers/finished_point_serializer.rb
acidic_job-0.8.8 lib/acidic_job/serializers/finished_point_serializer.rb
acidic_job-0.8.7 lib/acidic_job/serializers/finished_point_serializer.rb
acidic_job-0.8.5 lib/acidic_job/serializers/finished_point_serializer.rb
acidic_job-0.8.4 lib/acidic_job/serializers/finished_point_serializer.rb
acidic_job-0.8.3 lib/acidic_job/serializers/finished_point_serializer.rb
acidic_job-0.8.2 lib/acidic_job/serializers/finished_point_serializer.rb
acidic_job-0.8.1 lib/acidic_job/serializers/finished_point_serializer.rb
acidic_job-0.8.0 lib/acidic_job/serializers/finished_point_serializer.rb
acidic_job-1.0.0.beta.10 lib/acidic_job/serializers/finished_point_serializer.rb
acidic_job-1.0.0.beta.9 lib/acidic_job/serializers/finished_point_serializer.rb
acidic_job-1.0.0.beta.8 lib/acidic_job/serializers/finished_point_serializer.rb
acidic_job-1.0.0.beta.7 lib/acidic_job/serializers/finished_point_serializer.rb
acidic_job-1.0.0.beta.6 lib/acidic_job/serializers/finished_point_serializer.rb
acidic_job-1.0.0.beta.5 lib/acidic_job/serializers/finished_point_serializer.rb
acidic_job-1.0.0.beta.4 lib/acidic_job/serializers/finished_point_serializer.rb
acidic_job-1.0.0.beta.3 lib/acidic_job/serializers/finished_point_serializer.rb
acidic_job-1.0.0.beta.2 lib/acidic_job/serializers/finished_point_serializer.rb
acidic_job-1.0.0.beta.1 lib/acidic_job/serializers/finished_point_serializer.rb