55件ヒット
[1-55件を表示]
(0.144秒)
種類
- モジュール関数 (22)
- インスタンスメソッド (22)
- 特異メソッド (11)
ライブラリ
- json (55)
クラス
-
JSON
:: State (33)
モジュール
- JSON (22)
キーワード
- generate (11)
-
object
_ nl= (11) - unparse (11)
検索結果
先頭5件
-
JSON
:: State # object _ nl -> String (24337.0) -
JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列を返します。
...
JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列を返します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new(object_nl: "")
json_state.object_nl # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }......], json_state)
# => [1,2,{"name":"tanaka","age":19}]
json_state = JSON::State.new(object_nl: "\n")
json_state.object_nl # => "\n"
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{
# "name":"tanaka",
# "age":19
# }]
//}... -
JSON
:: State . new(options = {}) -> JSON :: State (21325.0) -
自身を初期化します。
...を初期化します。
@param options ハッシュを指定します。
指定可能なオプションは以下の通りです。
: :indent
インデントに使用する文字列を指定します。デフォルトは空文字列です。
: :space
JSON 形式の文字列のトーク......す。
: :space_before
JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の
前に挿入する文字列をセットします。デフォルトは空文字列です。
: :object_nl
JSON 形式の文字列中に現れる JavaScript のオブジェクト......ASCII 文字列のみを用いて JSON 形式の文字列を生成します。
デフォルトは偽です。
: :buffer_initial_length
sets the initial length of the generator's internal buffer.
//emlist[例 Hash を指定][ruby]{
require "json"
json_state = JSON::State.new(indent: "\t")
json_... -
JSON
:: State # object _ nl=(string) (12331.0) -
JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列をセットします。
...
JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列をセットします。
@param string JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列を指定します。
//emlist[例][ruby]{
require......"json"
json_state = JSON::State.new(object_nl: "")
json_state.object_nl # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]
json_state.object_nl = "\n"
json_state.object_nl # => "\n"
puts JSON.generate([1, 2, {......name: "tanaka", age: 19 }], json_state)
# => [1,2,{
# "name":"tanaka",
# "age":19
# }]
//}... -
JSON
. # generate(object , state = nil) -> String (3212.0) -
与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。
...ジェクトを一行の JSON 形式の文字列に変換して返します。
デフォルトでは、サイズが最小となる JSON 形式の文字列を生成します。
また、循環参照のチェックを行います。JSON::NaN, JSON::Infinity,
JSON::MinusInfinity を生成すること......: :indent
インデントに使用する文字列を指定します。デフォルトは空文字列です。
: :space
a string that is put after, a : or , delimiter (default: '')
: :space_before
a string that is put before a : pair delimiter (default: '')
: :object_nl
a string that is put......@raise JSON::CircularDatastructure 与えられたオブジェクトが循環参照を持つ場合に発生します。
//emlist[例][ruby]{
require "json"
JSON.generate([1, 2, { name: "tanaka", age: 19 }])
# => "[1,2,{\"name\":\"tanaka\",\"age\":19}]"
json_state = JSON::State.new(space: " ")
JSON... -
JSON
. # unparse(object , state = nil) -> String (3212.0) -
与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。
...ジェクトを一行の JSON 形式の文字列に変換して返します。
デフォルトでは、サイズが最小となる JSON 形式の文字列を生成します。
また、循環参照のチェックを行います。JSON::NaN, JSON::Infinity,
JSON::MinusInfinity を生成すること......: :indent
インデントに使用する文字列を指定します。デフォルトは空文字列です。
: :space
a string that is put after, a : or , delimiter (default: '')
: :space_before
a string that is put before a : pair delimiter (default: '')
: :object_nl
a string that is put......@raise JSON::CircularDatastructure 与えられたオブジェクトが循環参照を持つ場合に発生します。
//emlist[例][ruby]{
require "json"
JSON.generate([1, 2, { name: "tanaka", age: 19 }])
# => "[1,2,{\"name\":\"tanaka\",\"age\":19}]"
json_state = JSON::State.new(space: " ")
JSON...