るりまサーチ

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

別のキーワード

  1. struct new
  2. mkmf have_struct_member
  3. struct []
  4. struct each
  5. struct select

ライブラリ

キーワード

検索結果

<< < ... 2 3 4 >>

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

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

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

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

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

@see JSON::Generator::GeneratorMe...
<< < ... 2 3 4 >>