33件ヒット
[1-33件を表示]
(0.117秒)
種類
- インスタンスメソッド (22)
- モジュール関数 (11)
ライブラリ
- json (33)
クラス
-
JSON
:: State (22)
モジュール
- JSON (11)
キーワード
- dump (11)
-
max
_ nesting= (11)
検索結果
先頭3件
-
JSON
:: State # depth -> Integer (21217.0) -
This integer returns the current depth of data structure nesting.
...This integer returns the current depth of data structure nesting.... -
JSON
:: State # max _ nesting=(depth) (9201.0) -
生成される JSON 形式の文字列のネストの深さの最大値をセットします。
...される JSON 形式の文字列のネストの深さの最大値をセットします。
この値にゼロをセットすると、ネストの深さのチェックを行いません。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new(max_nesting: 2)
json_state.max_nesting......# => 2
JSON.generate([[]], json_state)
json_state.max_nesting = 3
json_state.max_nesting # => 3
JSON.generate([[[[]]]], json_state) # => JSON::NestingError
//}... -
JSON
. # dump(object , io = nil , limit = nil) -> String | IO (3306.0) -
与えられたオブジェクトを JSON 形式の文字列に変換してダンプします。
...オブジェクトを JSON 形式の文字列に変換してダンプします。
与えられたオブジェクトを引数として JSON.#generate を呼び出します。
@param object ダンプするオブジェクトを指定します。
@param io IO のように write メソッドを実......ます。
@param limit 指定した場合、limit 段以上深くリンクしたオブジェクトをダンプできません。
@raise ArgumentError オブジェクトのネストの深さが limit を越えた場合に発生します。
//emlist[例][ruby]{
require "json"
JSON.dump({ name: "ta......) # => "{\"name\":\"tanaka\",\"age\":19}"
//}
//emlist[例][ruby]{
require "json"
File.open("test.txt", "w") do |f|
JSON.dump([[[[[[[[[[]]]]]]]]]], f, 10) # => #<File:test.txt>
JSON.dump([[[[[[[[[[[]]]]]]]]]]], f, 10) # => exceed depth limit (ArgumentError)
end
//}
@see Marshal, Marshal.#du...