るりまサーチ

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

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

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.

...
T
his 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.

...
T
his 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.

...
T
his 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.

...
T
his 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)
//}...
<< 1 2 3 ... > >>