JSON for Ruby

openkk 12年前
     <p>这是一个 Ruby 语言用来操作 JSON 格式数据的程序库。</p>    <p>安装方法:gem install json</p>    <p>代码示例:</p>    <pre class="brush:ruby; toolbar: true; auto-links: false;">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</pre>    <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1324198136624" target="_blank">http://www.open-open.com/lib/view/home/1324198136624</a></p>    <p></p>