Sha256: 47cf161fbd565bb9bd0be23898a5f70d152070c6d714fdf9f67dbeb1e6efc69a
Contents?: true
Size: 694 Bytes
Versions: 50
Compression:
Stored size: 694 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 rescue ArgumentError # invalid byte sequence in UTF-8 raise ParseError end def dump(object, options={}) ::MultiJson::OkJson.valenc(stringify_keys(object)) end end end end
Version data entries
50 entries across 43 versions & 5 rubygems