Sha256: 81259097e4de13dac6d159abb1f1a76007e30dfaeab9cc91308225aa2d14d88a
Contents?: true
Size: 634 Bytes
Versions: 125
Compression:
Stored size: 634 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 = {}) 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, _ = {}) ::MultiJson::OkJson.valenc(stringify_keys(object)) end end end end
Version data entries
125 entries across 106 versions & 22 rubygems