るりまサーチ

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

別のキーワード

  1. module nesting
  2. state max_nesting
  3. _builtin nesting
  4. json max_nesting
  5. state max_nesting=

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 > >>

Module.nesting -> [Class, Module] (18107.0)

このメソッドを呼び出した時点でのクラス/モジュールのネスト情 報を配列に入れて返します。

...このメソッドを呼び出した時点でのクラス/モジュールのネスト情
報を配列に入れて返します。

//emlist[例][ruby]{
module Foo
module Bar
module Baz
p Module.nesting # => [Foo::Bar::Baz, Foo::Bar, Foo]
end
end
end
//}...

JSON::State#max_nesting -> Integer (6125.0)

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

..._nesting: 2)
json_state.max_nesting # => 2
JSON.generate([[]], json_state)
JSON.generate([[[]]], json_state) # => JSON::NestingError
//}

//emlist[例 ネストの深さチェックを行わない][ruby]{
require "json"

json_state = JSON::State.new(max_nesting: 0)
json_state.max_nesting...

JSON::State#max_nesting=(depth) (6125.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
//}...

static VALUE rb_mod_nesting(void) (6100.0)

JSON::NestingError (6000.0)

パースしようとしているデータ構造のネストが深すぎる場合に発生する例外です。

パースしようとしているデータ構造のネストが深すぎる場合に発生する例外です。

絞り込み条件を変える

JSON::State#depth=(depth) (32.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....

JSON::State#check_circular? -> bool (24.0)

循環参照のチェックを行う場合は、真を返します。 そうでない場合は偽を返します。

...]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
s = JSON.state.new
begin
JSON.generate(a, s)
rescue JSON::NestingError => e
[e, s.max_nesting, s.check_circular?] # => [#<JSON::NestingError: nesting of 100 is too deep>, 100, true]
end
//}

//emlist[例 ネストをチェックしないケース][ruby...
...]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
s2 = JSON.state.new(max_nesting: 0)
json = JSON.generate(a, s2)
[json, s2.max_nesting, s2.check_circular?] # => ["[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[...

変数と定数 (24.0)

変数と定数 * local * instance * class * class_var_scope * global * pseudo * const * prio

...nd
//}

ネストしているクラスの一覧は Class.nesting(あるいはModule.nesting)で取得できます。

//emlist[][ruby]{
module M1
module M2
p Module.nesting # => [M1::M2, M1]
end
end

module M1::M2
p Module.nesting # => [M1::M2]
end
//}

===== 他の値から :: で繋...

JSON::State#depth -> Integer (16.0)

This integer returns the current depth of data structure nesting.

...This integer returns the current depth of data structure nesting....
<< 1 2 3 > >>