るりまサーチ

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. ipaddr to_i

ライブラリ

クラス

モジュール

キーワード

検索結果

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"

j
son_state = JSON::State.new(max_nesting: 2)
j
son_state.max_nesting...
...# => 2
J
SON.generate([[]], json_state)
j
son_state.max_nesting = 3
j
son_state.max_nesting # => 3
J
SON.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"

J
SON.dump({ name: "ta...
...) # => "{\"name\":\"tanaka\",\"age\":19}"
//}

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

File.open("test.txt", "w") do |f|
J
SON.dump([[[[[[[[[[]]]]]]]]]], f, 10) # => #<File:test.txt>
J
SON.dump([[[[[[[[[[[]]]]]]]]]]], f, 10) # => exceed depth limit (ArgumentError)
end
//}

@see Marshal, Marshal.#du...