Sha256: 60da63b08fcebbd5d9304795a5fc33b1fe5aa96ba466596bd37059eff2b6a707

Contents?: true

Size: 609 Bytes

Versions: 67

Compression:

Stored size: 609 Bytes

Contents

require 'multi_json/adapter'
require 'multi_json/convertible_hash_keys'
require 'multi_json/vendor/okjson'

module MultiJson
  module Adapters
    class OkJson < Adapter
      include ConvertibleHashKeys
      ParseError = ::MultiJson::OkJson::Error

      def load(string, options={})
        string = string.read if string.respond_to?(:read)
        result = ::MultiJson::OkJson.decode("[#{string}]").first
        options[:symbolize_keys] ? symbolize_keys(result) : result
      end

      def dump(object, options={})
        ::MultiJson::OkJson.valenc(stringify_keys(object))
      end
    end
  end
end

Version data entries

67 entries across 65 versions & 10 rubygems

Version Path
scout-5.9.13 vendor/multi_json/lib/multi_json/adapters/ok_json.rb
scout-5.9.12 vendor/multi_json/lib/multi_json/adapters/ok_json.rb
scout-5.9.11 vendor/multi_json/lib/multi_json/adapters/ok_json.rb
scout-5.9.10.pre vendor/multi_json/lib/multi_json/adapters/ok_json.rb
scout-5.9.8 vendor/multi_json/lib/multi_json/adapters/ok_json.rb
scout-5.9.7.2.pre vendor/multi_json/lib/multi_json/adapters/ok_json.rb
scout-5.9.8.pre vendor/multi_json/lib/multi_json/adapters/ok_json.rb
scout-5.9.7.1 vendor/multi_json/lib/multi_json/adapters/ok_json.rb
scout-5.9.7.pre vendor/multi_json/lib/multi_json/adapters/ok_json.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/gems/multi_json-1.7.9/lib/multi_json/adapters/ok_json.rb
scout-5.9.5 vendor/multi_json/lib/multi_json/adapters/ok_json.rb
scout-5.9.4 vendor/multi_json/lib/multi_json/adapters/ok_json.rb
scout-5.9.4.pre vendor/multi_json/lib/multi_json/adapters/ok_json.rb
scout-5.9.3 vendor/multi_json/lib/multi_json/adapters/ok_json.rb
scout-5.9.2 vendor/multi_json/lib/multi_json/adapters/ok_json.rb
scout-5.9.1 vendor/multi_json/lib/multi_json/adapters/ok_json.rb
scout-5.9.1.pre vendor/multi_json/lib/multi_json/adapters/ok_json.rb
scout-5.9.0 vendor/multi_json/lib/multi_json/adapters/ok_json.rb
scout-5.9.0.pre vendor/multi_json/lib/multi_json/adapters/ok_json.rb
scout-5.8.9 vendor/multi_json/lib/multi_json/adapters/ok_json.rb