Sha256: cdaa1a0dfc6303cf19c8b78f52a8cf5b9978288fd533a2a174659fbd13e5abaa
Contents?: true
Size: 670 Bytes
Versions: 46
Compression:
Stored size: 670 Bytes
Contents
require 'oj' unless defined?(::Oj) require 'multi_json/adapter' module MultiJson module Adapters # Use the Oj library to dump/load. class Oj < Adapter defaults :load, :mode => :strict, :symbolize_keys => false defaults :dump, :mode => :compat, :time_format => :ruby ParseError = defined?(::Oj::ParseError) ? ::Oj::ParseError : SyntaxError def load(string, options={}) options[:symbol_keys] = options.delete(:symbolize_keys) ::Oj.load(string, options) end def dump(object, options={}) options.merge!(:indent => 2) if options[:pretty] ::Oj.dump(object, options) end end end end
Version data entries
46 entries across 45 versions & 6 rubygems