るりまサーチ (Ruby 2.5.0)

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

別のキーワード

  1. json to_json
  2. json state
  3. json parser
  4. json parse
  5. json []

ライブラリ

クラス

モジュール

キーワード

検索結果

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

This integer returns the current depth of data structure nesting.

This integer returns the current depth of data structure nesting.

JSON::State#depth=(depth) (51703.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.#dump(object, io = nil, limit = nil) -> String | IO (51175.0)

与えられたオブジェクトを JSON 形式の文字列に変換してダンプします。

与えられたオブジェクトを JSON 形式の文字列に変換してダンプします。

与えられたオブジェクトを引数として JSON.#generate を呼び出します。


@param object ダンプするオブジェクトを指定します。

@param io IO のように write メソッドを実装しているオブジェクトを指定します。

@param limit 指定した場合、limit 段以上深くリンクしたオブジェクトをダンプできません。

@raise ArgumentError オブジェクトのネストの深さが limit を越えた場合に発生します。

//emlist[例][ruby]{
re...

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

JSON::State#to_h -> Hash (33091.0)

自身をハッシュに変換します。

自身をハッシュに変換します。

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

json_state = JSON::State.new
pp json_state.to_h

# => {:indent=>"",
# :space=>"",
# :space_before=>"",
# :object_nl=>"",
# :array_nl=>"",
# :allow_nan=>false,
# :ascii_only=>false,
# :max_nesting=>100,
# ...

絞り込み条件を変える

JSON::State#to_hash -> Hash (33091.0)

自身をハッシュに変換します。

自身をハッシュに変換します。

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

json_state = JSON::State.new
pp json_state.to_h

# => {:indent=>"",
# :space=>"",
# :space_before=>"",
# :object_nl=>"",
# :array_nl=>"",
# :allow_nan=>false,
# :ascii_only=>false,
# :max_nesting=>100,
# ...