るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.062秒)
トップページ > クエリ:r[x] > ライブラリ:json/add/rational[x]

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. fileutils rm_r
  5. fileutils cp_r

クラス

キーワード

検索結果

Rational.json_create(hash) -> Rational (6102.0)

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

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

@param hash 分子をキー 'n'、分母をキー 'd' に持つハッシュを指定します。...

Rational#to_json(*args) -> String (3102.0)

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

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

@param args 使用しません。

//emlist[例][ruby]{
r
equire 'json/add/rational'
R
ational(1, 3).to_json # => "{\"json_class\":\"Rational\",\"n\":1,\"d\":3}"
//}

@see JSON::Generator::GeneratorMethods::Hash#to_...
...ON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。

@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json
に渡されます。

//emlist[例][ruby]{
r
equire 'json/add/rational'
R
ational(1, 3).to_json # => "{\"json_class\":\"Rational\...
...",\"n\":1,\"d\":3}"
//}

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