種類
- インスタンスメソッド (55)
- モジュール (44)
- モジュール関数 (22)
- 特異メソッド (11)
クラス
- DateTime (11)
-
JSON
:: State (55)
モジュール
- JSON (22)
キーワード
- Extend (11)
- Integer (11)
- NilClass (11)
- String (11)
-
buffer
_ initial _ length (11) -
buffer
_ initial _ length= (11) -
check
_ circular? (11) - depth (11)
- generate (11)
- new (11)
-
to
_ json (11) - unparse (11)
検索結果
先頭5件
-
JSON
:: Ext :: Generator :: GeneratorMethods :: NilClass (15018.0) -
Alias of JSON::Generator::GeneratorMethods::NilClass
...Alias of JSON::Generator::GeneratorMethods::NilClass... -
JSON
:: State # buffer _ initial _ length -> Integer (12318.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 (12232.0) -
循環参照のチェックを行う場合は、真を返します。 そうでない場合は偽を返します。
...emlist[例 ネストをチェックするケース][ruby]{
require "json"
a = [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[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 is too deep>, 100, true]
end
//}
//emlist[例 ネストをチェックしないケース][ruby]{
require "json"
a = [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[......]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
s2 = JSON.state.new(max_nesting: 0)
json = JSON.generate(a, s2)
[json, s2.max_nesting, s2.check_circular?] # => ["[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[... -
JSON
:: State # buffer _ initial _ length=(length) (12218.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
:: Ext :: Generator :: GeneratorMethods :: Integer (12018.0) -
Alias of JSON::Generator::GeneratorMethods::Integer
...Alias of JSON::Generator::GeneratorMethods::Integer... -
JSON
:: Ext :: Generator :: GeneratorMethods :: String (12018.0) -
Alias of JSON::Generator::GeneratorMethods::String
...Alias of JSON::Generator::GeneratorMethods::String... -
JSON
:: Ext :: Generator :: GeneratorMethods :: String :: Extend (9018.0) -
Alias of JSON::Generator::GeneratorMethods::String::Extend
...Alias of JSON::Generator::GeneratorMethods::String::Extend... -
JSON
. # generate(object , state = nil) -> String (6362.0) -
与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。
...ジェクトを一行の JSON 形式の文字列に変換して返します。
デフォルトでは、サイズが最小となる JSON 形式の文字列を生成します。
また、循環参照のチェックを行います。JSON::NaN, JSON::Infinity,
JSON::MinusInfinity を生成すること......もありません。
unparse は将来削除される予定です。
@param object JSON 形式の文字列に変換するオブジェクトを指定します。
@param state JSON::State または、to_hash や to_h メソッドでハッシュに変換可能なオブジェクトを指定できま......: :space
a string that is put after, a : or , delimiter (default: '')
: :space_before
a string that is put before a : pair delimiter (default: '')
: :object_nl
a string that is put at the end of a JSON object (default: '')
: :array_nl
a string that is put at the end of a JSON array (default:... -
JSON
. # unparse(object , state = nil) -> String (6262.0) -
与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。
...ジェクトを一行の JSON 形式の文字列に変換して返します。
デフォルトでは、サイズが最小となる JSON 形式の文字列を生成します。
また、循環参照のチェックを行います。JSON::NaN, JSON::Infinity,
JSON::MinusInfinity を生成すること......もありません。
unparse は将来削除される予定です。
@param object JSON 形式の文字列に変換するオブジェクトを指定します。
@param state JSON::State または、to_hash や to_h メソッドでハッシュに変換可能なオブジェクトを指定できま......: :space
a string that is put after, a : or , delimiter (default: '')
: :space_before
a string that is put before a : pair delimiter (default: '')
: :object_nl
a string that is put at the end of a JSON object (default: '')
: :array_nl
a string that is put at the end of a JSON array (default:... -
DateTime
# to _ json(*args) -> String (6207.0) -
自身を JSON 形式の文字列に変換して返します。
...自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡......されます。
//emlist[例][ruby]{
require "json/add/core"
DateTime.now.to_json
# => "{\"json_class\":\"DateTime\",\"y\":2018,\"m\":12,\"d\":10,\"H\":1,\"M\":28,\"S\":57,\"of\":\"3/8\",\"sg\":2299161.0}"
//}
@see JSON::Generator::GeneratorMethods::Hash#to_json...