D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
usr
/
share
/
ruby
/
json
/
add
/
Filename :
complex.rb
back
Copy
#frozen_string_literal: false unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED require 'json' end defined?(::Complex) or require 'complex' class Complex # Deserializes JSON string by converting Real value <tt>r</tt>, imaginary # value <tt>i</tt>, to a Complex object. def self.json_create(object) Complex(object['r'], object['i']) end # Returns a hash, that will be turned into a JSON object and represent this # object. def as_json(*) { JSON.create_id => self.class.name, 'r' => real, 'i' => imag, } end # Stores class name (Complex) along with real value <tt>r</tt> and imaginary value <tt>i</tt> as JSON string def to_json(*) as_json.to_json end end
Name
Size
Last Modified
Owner
Permissions
Actions
bigdecimal.rb
0.584
KB
December 06 2024 2:24:35
root
0644
complex.rb
0.731
KB
December 06 2024 2:24:35
root
0644
core.rb
0.34
KB
December 06 2024 2:24:35
root
0644
date.rb
0.86
KB
December 06 2024 2:24:35
root
0644
date_time.rb
1.297
KB
December 06 2024 2:24:35
root
0644
exception.rb
0.78
KB
December 06 2024 2:24:35
root
0644
ostruct.rb
0.778
KB
December 06 2024 2:24:35
root
0644
range.rb
0.768
KB
December 06 2024 2:24:35
root
0644
rational.rb
0.762
KB
December 06 2024 2:24:35
root
0644
regexp.rb
0.742
KB
December 06 2024 2:24:35
root
0644
struct.rb
0.768
KB
December 06 2024 2:24:35
root
0644
symbol.rb
0.6
KB
December 06 2024 2:24:35
root
0644
time.rb
0.992
KB
December 06 2024 2:24:35
root
0644
2017 © D7net | D704T team