diff options
Diffstat (limited to 'ruby_2_2/ext/json/lib/json/add/complex.rb')
-rw-r--r-- | ruby_2_2/ext/json/lib/json/add/complex.rb | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/ruby_2_2/ext/json/lib/json/add/complex.rb b/ruby_2_2/ext/json/lib/json/add/complex.rb deleted file mode 100644 index d7ebebf5f7..0000000000 --- a/ruby_2_2/ext/json/lib/json/add/complex.rb +++ /dev/null @@ -1,22 +0,0 @@ -unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED - require 'json' -end -defined?(::Complex) or require 'complex' - -class Complex - def self.json_create(object) - Complex(object['r'], object['i']) - end - - def as_json(*) - { - JSON.create_id => self.class.name, - 'r' => real, - 'i' => imag, - } - end - - def to_json(*) - as_json.to_json - end -end |