Module: Kernel

Defined in:
lib/yajl/json_gem.rb

Instance Method Summary collapse

Instance Method Details

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



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

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