123456789_123456789_123456789_123456789_123456789_

Module: Kernel

Relationships & Source Files
Defined in: ext/json/lib/json/common.rb

Instance Method Summary

  • JSON(object, opts = nil) private

    If object is string-like, parse the string and return the parsed result as a Ruby data structure.

Instance Method Details

JSON(object, opts = nil) (private)

If object is string-like, parse the string and return the parsed result as a Ruby data structure. Otherwise, generate a JSON text from the Ruby data structure object and return it.

The opts argument is passed through to generate/parse respectively. See generate and parse for their documentation.

[ GitHub ]

  
# File 'ext/json/lib/json/common.rb', line 908

def JSON(object, opts = nil)
  JSON[object, opts]
end