るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.006秒)
トップページ > クラス:Complex[x] > ライブラリ:json/add/complex[x] > バージョン:2.3.0[x]

キーワード

検索結果

Complex#to_json(*args) -> String (10.0)

自身を JSON 形式の文字列に変換して返します。

...ら JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。

@param args 使用しません。

//emlist[例][ruby]{
require 'json/add/complex'
Complex
(2, 3).to_json # => "{\"json_class\":\"Complex\",\"r\":2,\"i\":3}"
//}

@see JSON::Generator::GeneratorMethods::Hash#to_json...

Complex.json_create(hash) -> Complex (10.0)

JSON のオブジェクトから Complex のオブジェクトを生成して返します。

...JSON のオブジェクトから Complex のオブジェクトを生成して返します。

@param hash 実部をキー 'r'、虚部をキー 'i' に持つハッシュを指定します。...