Module: Kernel

Defined in:
lib/yajl/json_gem.rb

Instance Method Summary collapse

Instance Method Details

#JSON(object, opts = {}) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/yajl/json_gem.rb', line 7

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