Sha256: 5a6441990193516793e33c3bece07e756513bd9d6e51611ded2af44590d0a0de

Contents?: true

Size: 473 Bytes

Versions: 11

Compression:

Stored size: 473 Bytes

Contents

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={})
        string = string.read if StringIO === string
        ::Gson::Decoder.new(options).decode(string)
      end

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

Version data entries

11 entries across 4 versions & 4 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/multi_json-1.10.1/lib/multi_json/adapters/gson.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/multi_json-1.10.1/lib/multi_json/adapters/gson.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/adapters/gson.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/multi_json-1.10.1/lib/multi_json/adapters/gson.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/adapters/gson.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/multi_json-1.10.1/lib/multi_json/adapters/gson.rb
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/multi_json-1.10.1/lib/multi_json/adapters/gson.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/adapters/gson.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/multi_json-1.10.1/lib/multi_json/adapters/gson.rb
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/multi_json-1.10.1/lib/multi_json/adapters/gson.rb
multi_json-1.10.1 lib/multi_json/adapters/gson.rb