るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.144秒)

別のキーワード

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

ライブラリ

検索結果

Struct#to_json(*args) -> String (3114.0)

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

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

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

//emlist[例][ruby]{
require
"json/add/core"

Person = Struct.new(:name, :age)
Person.new("tanaka", 29).t...
...o_json # => "{\"json_class\":\"Person\",\"v\":[\"tanaka\",29]}"
//}

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