Sha256: f47b7e235d808b5e5f94267793d48fbab33d124cb8a5596f0395919a1c89d0cc

Contents?: true

Size: 540 Bytes

Versions: 12

Compression:

Stored size: 540 Bytes

Contents

require 'msgpack'
require 'action_dispatch'

module Acfs
  module Middleware
    class MessagePack < Serializer
      unless defined?(::Mime::MSGPACK)
        ::Mime::Type.register 'application/x-msgpack', :msgpack
      end

      def mime
        ::Mime[:msgpack]
      end

      def encode(data)
        ::MessagePack.pack data
      end

      def decode(body)
        ::MessagePack.unpack body
      end
    end

    # @deprecated
    MessagePackEncoder = MessagePack

    # @deprecated
    MessagePackDecoder = MessagePack
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
acfs-1.3.2 lib/acfs/middleware/msgpack.rb
acfs-1.3.1 lib/acfs/middleware/msgpack.rb
acfs-1.3.0 lib/acfs/middleware/msgpack.rb
acfs-1.2.1 lib/acfs/middleware/msgpack.rb
acfs-0.50.0 lib/acfs/middleware/msgpack.rb
acfs-1.2.0 lib/acfs/middleware/msgpack.rb
acfs-0.49.1 lib/acfs/middleware/msgpack.rb
acfs-1.1.1 lib/acfs/middleware/msgpack.rb
acfs-0.49.0 lib/acfs/middleware/msgpack.rb
acfs-1.1.0 lib/acfs/middleware/msgpack.rb
acfs-0.48.2 lib/acfs/middleware/msgpack.rb
acfs-1.0.1 lib/acfs/middleware/msgpack.rb