種類
- インスタンスメソッド (348)
- 特異メソッド (24)
ライブラリ
- json (372)
キーワード
- [] (12)
- []= (12)
-
allow
_ nan? (12) -
array
_ nl (12) -
array
_ nl= (12) -
ascii
_ only? (12) -
buffer
_ initial _ length (12) -
buffer
_ initial _ length= (12) -
check
_ circular? (12) - configure (12)
- depth (12)
- depth= (12)
-
from
_ state (12) - generate (12)
- indent (12)
- indent= (12)
-
max
_ nesting (12) -
max
_ nesting= (12) - merge (12)
- new (12)
-
object
_ nl (12) -
object
_ nl= (12) -
quirks
_ mode (12) -
quirks
_ mode= (12) -
quirks
_ mode? (12) - space (12)
- space= (12)
-
space
_ before (12) -
space
_ before= (12) -
to
_ h (12) -
to
_ hash (12)
検索結果
先頭5件
-
JSON
:: State . from _ state(options) -> JSON :: State (9225.0) -
与えられた options によって生成した JSON::State のインスタンスを返します。
...えられた options によって生成した JSON::State のインスタンスを返します。
@param options JSON::State のインスタンスか、ハッシュを指定します。
@return options がハッシュである場合は、それによって初期化した JSON::State を......。options が JSON::State のインスタンスである場合は単に
options を返します。いずれでも無い場合は、何も設定されていない JSON::State の
インスタンスを返します。
//emlist[例 Hash を指定][ruby]{
require "json"
json_state = JS......:State.from_state(indent: "\t")
json_state.class # => JSON::Ext::Generator::State
json_state.indent # => "\t"
//}
//emlist[例 JSON::State を指定][ruby]{
require "json"
json_state = JSON::State.from_state(indent: "\t")
# JSON を出力する何らかの処理を実行する
copy = JSON::State.... -
JSON
:: State # depth=(depth) (6201.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 # indent -> String (6125.0) -
インデントに使用する文字列を返します。
...インデントに使用する文字列を返します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new(indent: "\t")
json_state.indent # => "\t"
JSON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{\t\"key1\":\"value1\",\t\"key2\":\"value2\"}"
//}... -
JSON
:: State # indent=(string) (6125.0) -
インデントに使用する文字列をセットします。
...string インデントに使用する文字列を指定します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new(indent: "\t")
json_state.indent # => "\t"
JSON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{\t\"key1\":\"value1\",\t\"key2\":\"value2\"}"
json_state.......indent = " "
JSON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{ \"key1\":\"value1\", \"key2\":\"value2\"}"
//}... -
JSON
:: State # buffer _ initial _ length=(length) (6117.0) -
This sets the initial length of the buffer to length, if length > 0, otherwise its value isn't changed.
...
This sets the initial length of the buffer to length, if length > 0,
otherwise its value isn't changed.... -
JSON
:: State # buffer _ initial _ length -> Integer (6101.0) -
This integer returns the current initial length of the buffer.
...
This integer returns the current initial length of the buffer.... -
JSON
:: State # depth -> Integer (6101.0) -
This integer returns the current depth of data structure nesting.
...
This integer returns the current depth of data structure nesting.... -
JSON
:: State # generate(obj) -> String (6101.0) -
Generates a valid JSON document from object obj and returns the result. If no valid JSON document can be created this method raises a GeneratorError exception.
...Generates a valid JSON document from object obj and returns the
result. If no valid JSON document can be created this method raises a
GeneratorError exception.... -
JSON
:: State # max _ nesting -> Integer (6101.0) -
生成される JSON 形式の文字列のネストの深さの最大値を返します。
...ません。
//emlist[例 ネストの深さチェックを行う][ruby]{
require "json"
json_state = JSON::State.new(max_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 # => 0
JSON.generate([[[[[[[[[[]]]]]]]]]], json_state)
//}...