且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将Ruby对象转换为JSON

更新时间:2023-02-15 17:50:26

是的,您可以使用

Yes, you can do it with to_json.

如果您没有运行Rails,则可能需要require 'json'.

You may need to require 'json' if you're not running Rails.