JSON for Ruby -


Ruby License
跨平台
Ruby

软件简介

这是一个 Ruby 语言用来操作 JSON 格式数据的程序库。

安装方法:gem install json

代码示例:

class Range  
  def to_json(*a)  
    {  
      'json_class'   => self.class.name,  
      'data'         => [ first, last, exclude_end? ]  
    }.to_json(*a)  
  end

  def self.json_create(o)  
    new(*o['data'])  
  end  
end

JSON:JavaScript Object Notation