require 'snappy'

module Ripple
  module SnappySerializer
    extend self

    def dump(obj)
      Snappy.deflate obj.to_json(Riak.json_options)
    end

    def load(binary)
      Riak::JSON.parse(Snappy.inflate binary)
    end
  end
end

Riak::Serializers['application/x-snappy'] = Ripple::SnappySerializer

require 'snappy'

module Ripple
  module SnappySerializer
    extend self

    def dump(obj)
      Snappy.deflate Riak::JSON.encode(obj)
    end

    def load(binary)
      Riak::JSON.parse(Snappy.inflate binary)
    end
  end
end

Riak::Serializers['application/x-snappy'] = Ripple::SnappySerializer

Make sure multi_json is used to encode/decode json
Make sure multi_json is used to encode/decode json
