Sha256: 466936518364f7aed018b3faffc1b6b439c683b9029b7e8f238bb9fcbdcd78f4
Contents?: true
Size: 639 Bytes
Versions: 35
Compression:
Stored size: 639 Bytes
Contents
module MultiJson module Engines module JsonCommon def decode(string, options = {}) opts = {} opts[:symbolize_names] = options[:symbolize_keys] string = string.read if string.respond_to?(:read) ::JSON.parse(string, opts) end def encode(object, options = {}) object.to_json(process_options(options)) end protected def process_options(options={}) return options if options.empty? opts = {} opts.merge!(JSON::PRETTY_STATE_PROTOTYPE.to_h) if options.delete(:pretty) opts.merge! options end end end end
Version data entries
35 entries across 30 versions & 6 rubygems