るりまサーチ

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

別のキーワード

  1. uri default_port
  2. _builtin default
  3. socket ai_default
  4. generic default_port
  5. socket ip_default_multicast_ttl

モジュール

キーワード

検索結果

JSON.#generate(object, state = nil) -> String (32.0)

与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。

...オブジェクトを一行の JSON 形式の文字列に変換して返します。

デフォルトでは、サイズが最小となる JSON 形式の文字列を生成します。
また、循環参照のチェックを行います。JSON::NaN, JSON::Infinity,
JSON
::MinusInfinity を生成する...
...ut after, a : or , delimiter (default: '')
: :space_before
a string that is put before a : pair delimiter (default: '')
: :object_nl
a string that is put at the end of a JSON object (default: '')
: :array_nl
a string that is put at the end of a JSON array (default: '')
: :check_circular
...
...ire "json"

JSON
.generate([1, 2, { name: "tanaka", age: 19 }])
# => "[1,2,{\"name\":\"tanaka\",\"age\":19}]"
json
_state = JSON::State.new(space: " ")
JSON
.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => "[1,2,{\"name\": \"tanaka\",\"age\": 19}]"
//}

@see JSON::State, JSON.#pretty_gen...

JSON.#unparse(object, state = nil) -> String (32.0)

与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。

...オブジェクトを一行の JSON 形式の文字列に変換して返します。

デフォルトでは、サイズが最小となる JSON 形式の文字列を生成します。
また、循環参照のチェックを行います。JSON::NaN, JSON::Infinity,
JSON
::MinusInfinity を生成する...
...ut after, a : or , delimiter (default: '')
: :space_before
a string that is put before a : pair delimiter (default: '')
: :object_nl
a string that is put at the end of a JSON object (default: '')
: :array_nl
a string that is put at the end of a JSON array (default: '')
: :check_circular
...
...ire "json"

JSON
.generate([1, 2, { name: "tanaka", age: 19 }])
# => "[1,2,{\"name\":\"tanaka\",\"age\":19}]"
json
_state = JSON::State.new(space: " ")
JSON
.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => "[1,2,{\"name\": \"tanaka\",\"age\": 19}]"
//}

@see JSON::State, JSON.#pretty_gen...