るりまサーチ

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

別のキーワード

  1. json state
  2. random state
  3. _builtin state
  4. state max_nesting=
  5. state max_nesting

ライブラリ

クラス

検索結果

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

生成される 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::State#depth=(depth) (6016.0)

This sets the maximum level of data structure nesting in the generated JSON to the integer depth, max_nesting = 0 if no maximum should be checked.

...This sets the maximum level of data structure nesting in the generated
JSON to the integer depth, max_nesting = 0 if no maximum should be
checked....