Module: Kernel

Defined in:
lib/ffi_yajl/json_gem.rb

Instance Method Summary collapse

Instance Method Details

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



105
106
107
108
109
110
111
# File 'lib/ffi_yajl/json_gem.rb', line 105

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