aboutsummaryrefslogblamecommitdiffstats
path: root/activejob/lib/active_job/serializers/base_serializer.rb
blob: 8b891cca48ae6be3ba5621ad1517bb1e03ae9ce3 (plain) (tree)
1
2
3
4
5
6
7
8
9








                                

















                                   



         
# frozen_string_literal: true

module ActiveJob
  module Serializers
    class BaseSerializer
      class << self
        def serialize?(argument)
          argument.is_a?(klass)
        end

        def deserialize?(_argument)
          raise NotImplementedError
        end

        def serialize(_argument)
          raise NotImplementedError
        end

        def deserialize(_argument)
          raise NotImplementedError
        end

        private

        def klass
          raise NotImplementedError
        end
      end
    end
  end
end