# File lib/multi_json/engines/json_common.rb, line 5 def decode(string, options = {}) opts = {} opts[:symbolize_names] = options[:symbolize_keys] string = string.read if string.respond_to?(:read) ::JSON.parse(string, opts) end
# File lib/multi_json/engines/json_common.rb, line 12 def encode(object, options = {}) object.to_json(process_options(options)) end
# File lib/multi_json/engines/json_common.rb, line 18 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
[Validate]
Generated with the Darkfish Rdoc Generator 2.