るりまサーチ (Ruby 3.2)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.035秒)
トップページ > クエリ:IO[x] > クエリ:JSON[x] > クラス:Rational[x] > クエリ:to_json[x] > バージョン:3.2[x]

別のキーワード

  1. json to_json
  2. json parser
  3. json state
  4. json parse
  5. json []

ライブラリ

検索結果

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

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

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

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

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