るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.032秒)
トップページ > クエリ:ruby[x] > クエリ:JSON[x] > クラス:JSON::State[x] > クエリ:max_nesting=[x]

別のキーワード

  1. _builtin max
  2. _builtin max_by
  3. enumerable max_by
  4. enumerable max
  5. range max

ライブラリ

検索結果

JSON::State#max_nesting=(depth) (21195.0)

生成される JSON 形式の文字列のネストの深さの最大値をセットします。

...生成される JSON 形式の文字列のネストの深さの最大値をセットします。

この値にゼロをセットすると、ネストの深さのチェックを行いません。

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

json
_state = JSON::State.new(max_nesting: 2)
json
_state.max_nestin...
...g # => 2
JSON
.generate([[]], json_state)
json
_state.max_nesting = 3
json
_state.max_nesting # => 3
JSON
.generate([[[[]]]], json_state) # => JSON::NestingError
//}...