Sha256: a1a7710f1498bf5ec092aaa76ed498821cd608a6d856bf1709ca709aa61ad1c3

Contents?: true

Size: 320 Bytes

Versions: 6

Compression:

Stored size: 320 Bytes

Contents

# need custom class due to
# https://github.com/rails/rails/issues/47185
module Mailkick
  class Serializer
    def self.dump(value)
      ActiveSupport::JSON.encode(value)
    end

    def self.load(value)
      ActiveSupport::JSON.decode(value)
    rescue JSON::ParserError
      Marshal.load(value)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mailkick-1.3.1 lib/mailkick/serializer.rb
mailkick-1.3.0 lib/mailkick/serializer.rb
mailkick-1.2.2 lib/mailkick/serializer.rb
mailkick-1.2.1 lib/mailkick/serializer.rb
mailkick-1.2.0 lib/mailkick/serializer.rb
mailkick-1.1.2 lib/mailkick/serializer.rb