From 062d2ee6f798205c3046730d0d348cfd0d0bc09d Mon Sep 17 00:00:00 2001 From: naruse Date: Tue, 12 Feb 2013 03:05:45 +0000 Subject: * ext/json: merge JSON 1.7.7. This includes security fix. [CVE-2013-0269] https://github.com/flori/json/commit/d0a62f3ced7560daba2ad546d83f0479a5ae2cf2 https://groups.google.com/d/topic/rubyonrails-security/4_YvCpLzL58/discussion git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/json/lib/json/add/bigdecimal.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ext/json/lib/json/add') diff --git a/ext/json/lib/json/add/bigdecimal.rb b/ext/json/lib/json/add/bigdecimal.rb index 4aafe537ab..0ef69f12e0 100644 --- a/ext/json/lib/json/add/bigdecimal.rb +++ b/ext/json/lib/json/add/bigdecimal.rb @@ -4,10 +4,16 @@ end defined?(::BigDecimal) or require 'bigdecimal' class BigDecimal + # Import a JSON Marshalled object. + # + # method used for JSON marshalling support. def self.json_create(object) BigDecimal._load object['b'] end + # Marshal the object to JSON. + # + # method used for JSON marshalling support. def as_json(*) { JSON.create_id => self.class.name, @@ -15,6 +21,7 @@ class BigDecimal } end + # return the JSON value def to_json(*) as_json.to_json end -- cgit v1.2.3