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









                                                           
                                                        


                              
                                                          




                 
               




           
# frozen_string_literal: true

module ActiveJob
  module Serializers
    # Provides methods to serialize and deserialize `Array`
    class ArraySerializer < BaseSerializer
      class << self
        alias_method :deserialize?, :serialize?

        def serialize(array)
          array.map { |arg| Serializers.serialize(arg) }
        end

        def deserialize(array)
          array.map { |arg| Serializers.deserialize(arg) }
        end

        private

        def klass
          Array
        end
      end
    end
  end
end