るりまサーチ (Ruby 2.3.0)

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

別のキーワード

  1. socket ai_v4mapped
  2. socket ipv6_v6only
  3. socket ai_v4mapped_cfg
  4. _builtin grep_v
  5. etc cs_v6_env

クラス

キーワード

検索結果

JSON::State#[]=(name, value) (310.0)

Set the attribute name to value.

Set the attribute name to value.

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

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

...自身を 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).to_json # => "{\"json_class\":\"Person\",\"v\":[\"tanaka\",29]}"
//}

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