Sha256: b71845c7b0375c60e3984fc9da7f5a686ee0818d85ad331fbea9f78844290afb

Contents?: true

Size: 502 Bytes

Versions: 8

Compression:

Stored size: 502 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

    MessagePackEncoder = MessagePack
    MessagePackDecoder = MessagePack
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
acfs-0.44.0 lib/acfs/middleware/msgpack.rb
acfs-0.43.2 lib/acfs/middleware/msgpack.rb
acfs-0.43.1 lib/acfs/middleware/msgpack.rb
acfs-0.43.0 lib/acfs/middleware/msgpack.rb
acfs-0.42.0 lib/acfs/middleware/msgpack.rb
acfs-0.41.1 lib/acfs/middleware/msgpack.rb
acfs-0.41.1.beta1 lib/acfs/middleware/msgpack.rb
acfs-0.41.0 lib/acfs/middleware/msgpack.rb