231件ヒット
[1-100件を表示]
(0.080秒)
種類
- インスタンスメソッド (209)
- 特異メソッド (22)
ライブラリ
- json (231)
キーワード
- [] (11)
-
allow
_ nan? (11) -
array
_ nl (11) -
ascii
_ only? (11) -
buffer
_ initial _ length (11) -
check
_ circular? (11) - configure (11)
- depth (11)
-
from
_ state (11) - generate (11)
- indent (11)
-
max
_ nesting (11) - merge (11)
- new (11)
-
object
_ nl (11) -
quirks
_ mode (11) -
quirks
_ mode? (11) - space (11)
-
space
_ before (11) -
to
_ h (11) -
to
_ hash (11)
検索結果
先頭5件
-
JSON
:: State . from _ state(options) -> JSON :: State (9301.0) -
与えられた options によって生成した JSON::State のインスタンスを返します。
...た JSON::State のインスタンスを返します。
@param options JSON::State のインスタンスか、ハッシュを指定します。
@return options がハッシュである場合は、それによって初期化した JSON::State を
返します。options が JSON::State の......ていない JSON::State の
インスタンスを返します。
//emlist[例 Hash を指定][ruby]{
require "json"
json_state = JSON::State.from_state(indent: "\t")
json_state.class # => JSON::Ext::Generator::State
json_state.indent # => "\t"
//}
//emlist[例 JSON::State を指定][rub......y]{
require "json"
json_state = JSON::State.from_state(indent: "\t")
# JSON を出力する何らかの処理を実行する
copy = JSON::State.from_state(json_state)
copy.class # => JSON::Ext::Generator::State
copy.indent # => "\t"
//}... -
JSON
:: State . new(options = {}) -> JSON :: State (3201.0) -
自身を初期化します。
...require "json"
json_state = JSON::State.new(indent: "\t")
json_state.class # => JSON::Ext::Generator::State
json_state.indent # => "\t"
//}
//emlist[例 JSON::State を指定][ruby]{
require "json"
json_state = JSON::State.new(indent: "\t")
copy = JSON::State.new(json_state)
copy.class # => JS... -
JSON
:: State # allow _ nan? -> bool (3117.0) -
NaN, Infinity, -Infinity を生成できる場合、真を返します。 そうでない場合は偽を返します。
...NaN, Infinity, -Infinity を生成できる場合、真を返します。
そうでない場合は偽を返します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new({})
json_state.allow_nan? # => false
json_state = JSON::State.new(allow_nan: true)
json_state.allow_nan? # => tr... -
JSON
:: State # [](name) -> object (3101.0) -
Return the value returned by method name.
Return the value returned by method name. -
JSON
:: State # array _ nl -> String (3101.0) -
JSON の配列の後に出力する文字列を返します。
...JSON の配列の後に出力する文字列を返します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new({})
json_state.array_nl # => ""
json_state = JSON::State.new(array_nl: "\n")
json_state.array_nl # => "\n"
//}... -
JSON
:: State # ascii _ only? -> bool (3101.0) -
ASCII 文字列のみを用いて JSON 形式の文字列を生成する場合に真を返します。 そうでない場合に偽を返します。
ASCII 文字列のみを用いて JSON 形式の文字列を生成する場合に真を返します。
そうでない場合に偽を返します。 -
JSON
:: State # buffer _ initial _ length -> Integer (3101.0) -
This integer returns the current initial length of the buffer.
This integer returns the current initial length of the buffer. -
JSON
:: State # check _ circular? -> bool (3101.0) -
循環参照のチェックを行う場合は、真を返します。 そうでない場合は偽を返します。
...[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[0]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
s = JSON.state.new
begin
JSON.generate(a, s)
rescue JSON::NestingError => e
[e, s.max_nesting, s.check_circular?] # => [#<JSON::NestingError: nesting of 100......[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[0]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
s2 = JSON.state.new(max_nesting: 0)
json = JSON.generate(a, s2)
[json, s2.max_nesting, s2.check_circular?] # => ["[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[... -
JSON
:: State # configure(options = {}) -> self (3101.0) -
与えられたハッシュで自身を設定します。
...シュのキーについては JSON::State.new を参照してください。
@param options このオブジェクトの設定をするためのハッシュを指定します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new(indent: "\t")
json_state.indent # => "\t"
JSON.generat......y1: "value1", key2: "value2"}, json_state)
# => "{\t\"key1\":\"value1\",\t\"key2\":\"value2\"}"
json_state.configure(indent: " ")
json_state.indent # => " "
JSON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{ \"key1\":\"value1\", \"key2\":\"value2\"}"
//}
@see JSON::State.new... -
JSON
:: State # depth -> Integer (3101.0) -
This integer returns the current depth of data structure nesting.
This integer returns the current depth of data structure nesting.