Sha256: e552772b6292e27733be71dda3978f8e5f4d7c913ebeb70b3e3ff05e405c631a
Contents?: true
Size: 648 Bytes
Versions: 37
Compression:
Stored size: 648 Bytes
Contents
require '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
37 entries across 37 versions & 2 rubygems