D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
td-agent
/
embedded
/
lib
/
ruby
/
gems
/
2.1.0
/
gems
/
yajl-ruby-1.3.0
/
lib
/
yajl
/
Filename :
json_gem.rb
back
Copy
require 'yajl' unless defined?(Yajl::Parser) require 'yajl/json_gem/parsing' require 'yajl/json_gem/encoding' module ::Kernel def JSON(object, opts = {}) if object.respond_to? :to_s JSON.parse(object.to_s, JSON.default_options.merge(opts)) else JSON.generate(object, opts) end end end