All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gems.multi_json-1.11.0.lib.multi_json.adapters.gson.rb Maven / Gradle / Ivy

There is a newer version: 3.7.2
Show newest version
require 'gson'
require 'stringio'
require 'multi_json/adapter'

module MultiJson
  module Adapters
    # Use the gson.rb library to dump/load.
    class Gson < Adapter
      ParseError = ::Gson::DecodeError

      def load(string, options={})
        ::Gson::Decoder.new(options).decode(string)
      end

      def dump(object, options={})
        ::Gson::Encoder.new(options).encode(object)
      end
    end
  end
end




© 2015 - 2025 Weber Informatics LLC | Privacy Policy