72件ヒット
[1-72件を表示]
(0.017秒)
種類
- インスタンスメソッド (60)
- モジュール関数 (12)
ライブラリ
- json (72)
クラス
-
JSON
:: State (60)
モジュール
- JSON (12)
キーワード
- depth= (12)
- dump (12)
-
max
_ nesting= (12) -
to
_ h (12) -
to
_ hash (12)
検索結果
先頭5件
-
JSON
:: State # depth -> Integer (21117.0) -
This integer returns the current depth of data structure nesting.
...This integer returns the current depth of data structure nesting.... -
JSON
. # dump(object , io = nil , limit = nil) -> String | IO (21058.0) -
与えられたオブジェクトを JSON 形式の文字列に変換してダンプします。
...与えられたオブジェクトを JSON 形式の文字列に変換してダンプします。
与えられたオブジェクトを引数として JSON.#generate を呼び出します。
@param object ダンプするオブジェクトを指定します。
@param io IO のように write メ......quire "json"
JSON.dump({ name: "tanaka", age: 19 }) # => "{\"name\":\"tanaka\",\"age\":19}"
//}
//emlist[例][ruby]{
require "json"
File.open("test.txt", "w") do |f|
JSON.dump([[[[[[[[[[]]]]]]]]]], f, 10) # => #<File:test.txt>
JSON.dump([[[[[[[[[[[]]]]]]]]]]], f, 10) # => exceed depth limit... -
JSON
:: State # depth=(depth) (9234.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 # max _ nesting=(depth) (3183.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
//}... -
JSON
:: State # to _ h -> Hash (3030.0) -
自身をハッシュに変換します。
...][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,
# :depth=>0,
# :buffer_i... -
JSON
:: State # to _ hash -> Hash (3030.0) -
自身をハッシュに変換します。
...][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,
# :depth=>0,
# :buffer_i...