Sha256: 8590b444126da758e634ff3645bb656a81585acad799958a687e7845061fa9f8

Contents?: true

Size: 326 Bytes

Versions: 20

Compression:

Stored size: 326 Bytes

Contents

module ZendeskAPI::Server
  class ZlibJSON < Hash
    class << self
      def demongoize(serialized_object)
        JSON.parse(Zlib.inflate(serialized_object.to_s)).symbolize_keys
      end

      def mongoize(input_hash)
        Moped::BSON::Binary.new(:generic, Zlib.deflate(input_hash.to_json))
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
zendesk_api-0.3.14 lib/zendesk_api/server/models/zlib_json.rb
zendesk_api-0.3.13 lib/zendesk_api/server/models/zlib_json.rb
zendesk_api-0.3.12 lib/zendesk_api/server/models/zlib_json.rb
zendesk_api-0.3.11 lib/zendesk_api/server/models/zlib_json.rb
zendesk_api-0.3.10 lib/zendesk_api/server/models/zlib_json.rb
zendesk_api-0.3.9 lib/zendesk_api/server/models/zlib_json.rb
zendesk_api-0.3.8 lib/zendesk_api/server/models/zlib_json.rb
zendesk_api-0.3.7 lib/zendesk_api/server/models/zlib_json.rb
zendesk_api-0.3.6 lib/zendesk_api/server/models/zlib_json.rb
zendesk_api-0.3.5 lib/zendesk_api/server/models/zlib_json.rb
zendesk_api-0.3.4 lib/zendesk_api/server/models/zlib_json.rb
zendesk_api-0.3.3 lib/zendesk_api/server/models/zlib_json.rb
zendesk_api-0.3.2 lib/zendesk_api/server/models/zlib_json.rb
zendesk_api-0.3.1 lib/zendesk_api/server/models/zlib_json.rb
zendesk_api-0.3.0 lib/zendesk_api/server/models/zlib_json.rb
zendesk_api-0.2.6 lib/zendesk_api/server/models/zlib_json.rb
zendesk_api-0.2.5 lib/zendesk_api/server/models/zlib_json.rb
zendesk_api-0.2.4 lib/zendesk_api/server/models/zlib_json.rb
zendesk_api-0.2.2 lib/zendesk_api/server/models/zlib_json.rb
zendesk_api-0.2.1 lib/zendesk_api/server/models/zlib_json.rb