るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
47件ヒット [1-47件を表示] (0.036秒)
トップページ > バージョン:2.3.0[x] > クエリ:json[x] > クエリ:state[x] > ライブラリ:json[x]

別のキーワード

  1. json to_json
  2. json parser
  3. json parse
  4. json []

検索結果

JSON.state -> JSON::Ext::Generator::State (106054.0)

JSON ライブラリがジェネレータの状態を表すクラスとして使用するクラスを返します。

...
JSON
ライブラリがジェネレータの状態を表すクラスとして使用するクラスを返します。

//emlist[例][ruby]{
require "json"

JSON
.state # => JSON::Ext::Generator::State
//}...

JSON::State.from_state(options) -> JSON::State (61660.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 を指定][...
...ruby]{
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.#generate(object, state = nil) -> String (51901.0)

与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。

...オブジェクトを一行の JSON 形式の文字列に変換して返します。

デフォルトでは、サイズが最小となる JSON 形式の文字列を生成します。
また、循環参照のチェックを行います。JSON::NaN, JSON::Infinity,
JSON
::MinusInfinity を生成する...
...こともありません。

unparse は将来削除される予定です。

@param object JSON 形式の文字列に変換するオブジェクトを指定します。

@param state JSON::State または、to_hash や to_h メソッドでハッシュに変換可能なオブジェクトを指定で...
...tring 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: '')
: :check_circular
真を指定した場合、生成するオブジェクトの循環...

JSON.#unparse(object, state = nil) -> String (51901.0)

与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。

...オブジェクトを一行の JSON 形式の文字列に変換して返します。

デフォルトでは、サイズが最小となる JSON 形式の文字列を生成します。
また、循環参照のチェックを行います。JSON::NaN, JSON::Infinity,
JSON
::MinusInfinity を生成する...
...こともありません。

unparse は将来削除される予定です。

@param object JSON 形式の文字列に変換するオブジェクトを指定します。

@param state JSON::State または、to_hash や to_h メソッドでハッシュに変換可能なオブジェクトを指定で...
...tring 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: '')
: :check_circular
真を指定した場合、生成するオブジェクトの循環...

JSON::Generator::GeneratorMethods::Object#to_json(state_or_hash = nil) -> String (51859.0)

自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。

...した結果を JSON 形式の文字列に変換して返します。

このメソッドはあるオブジェクトに to_json メソッドが定義されていない場合に使用する
フォールバックのためのメソッドです。

@param state_or_hash 生成する JSON 形式の文字...
...をカスタマイズするため
JSON::State のインスタンスか、
JSON
::State.new の引数と同じ Hash を
指定します。

//emlist[例][ruby]{
require "json"

class Person
attr :name, :age

def initialize(name, ag...
...e)
@name, @age = name, age
end
end

tanaka = Person.new("tanaka", 29)

tanaka.to_json # => "\"#<Person:0x00007ffdec0167c8>\""
tanaka.method(:to_json).owner # => JSON::Ext::Generator::GeneratorMethods::Object
//}...

絞り込み条件を変える

JSON::Generator::GeneratorMethods::String#to_json(state_or_hash = nil) -> String (51859.0)

自身から生成した JSON 形式の文字列を返します。

...ら生成した JSON 形式の文字列を返します。

自身のエンコードは UTF-8 であるべきです。
"\u????" のように UTF-16 ビッグエンディアンでエンコードされた文字列を返すことがあります。

@param state_or_hash 生成する JSON 形式の文字...
... JSON::State のインスタンスか、
JSON
::State.new の引数と同じ Hash を
指定します。

//emlist[例][ruby]{
require "json"

puts "test".to_json # => "test"
puts '"'.to_json #...
...=> "\""
puts "\\".to_json # => "\\"
puts "𤘩宮城".to_json(ascii_only: true) # => "\ud851\ude29\u5bae\u57ce"
//}...

JSON::Generator::GeneratorMethods::Array#to_json(state_or_hash = nil) -> String (51805.0)

自身から生成した JSON 形式の文字列を返します。

...自身から生成した JSON 形式の文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
JSON::State のインスタンスか、
JSON
::State.new の引数と同じ Hash を...
...指定します。

//emlist[例][ruby]{
require "json"

[1, 2, 3].to_json # => "[1,2,3]"
//}...

JSON::Generator::GeneratorMethods::FalseClass#to_json(state_or_hash = nil) -> String (51805.0)

自身から生成した JSON 形式の文字列を返します。

...ら生成した JSON 形式の文字列を返します。

"false" という文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
JSON::State のインスタンスか、
JSON
::State.new...
...の引数と同じ Hash を
指定します。

//emlist[例][ruby]{
require "json"

false.to_json # => "false"
//}...

JSON::Generator::GeneratorMethods::Float#to_json(state_or_hash = nil) -> String (51805.0)

自身から生成した JSON 形式の文字列を返します。

...自身から生成した JSON 形式の文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
JSON::State のインスタンスか、
JSON
::State.new の引数と同じ Hash を...
...指定します。

//emlist[例][ruby]{
require "json"

(1.0).to_json # => "1.0"
//}...

JSON::Generator::GeneratorMethods::Hash#to_json(state_or_hash = nil) -> String (51805.0)

自身から生成した JSON 形式の文字列を返します。

...自身から生成した JSON 形式の文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
JSON::State のインスタンスか、
JSON
::State.new の引数と同じ Hash を...
...指定します。

//emlist[例][ruby]{
require "json"

person = { "name" => "tanaka", "age" => 19 }
person.to_json # => "{\"name\":\"tanaka\",\"age\":19}"
//}...

絞り込み条件を変える

JSON::Generator::GeneratorMethods::Integer#to_json(state_or_hash = nil) -> String (51805.0)

自身から生成した JSON 形式の文字列を返します。

...自身から生成した JSON 形式の文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
JSON::State のインスタンスか、
JSON
::State.new の引数と同じ Hash を...
...指定します。

//emlist[例][ruby]{
require "json"

10.to_json # => "10"
//}...

JSON::Generator::GeneratorMethods::NilClass#to_json(state_or_hash = nil) -> String (51805.0)

自身から生成した JSON 形式の文字列を返します。

...ら生成した JSON 形式の文字列を返します。

"null" という文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
JSON::State のインスタンスか、
JSON
::State.new の...
...引数と同じ Hash を
指定します。

//emlist[例][ruby]{
require "json"

nil.to_json # => "null"
//}...

JSON::Generator::GeneratorMethods::TrueClass#to_json(state_or_hash = nil) -> String (51805.0)

自身から生成した JSON 形式の文字列を返します。

...ら生成した JSON 形式の文字列を返します。

"true" という文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
JSON::State のインスタンスか、
JSON
::State.new の...
...引数と同じ Hash を
指定します。

//emlist[例][ruby]{
require "json"

true.to_json # => "true"
//}...

JSON.#pretty_generate(object, options = nil) -> String (51235.0)

Ruby のオブジェクトを JSON 形式の文字列に変換して返します。

...Ruby のオブジェクトを JSON 形式の文字列に変換して返します。

このメソッドは JSON.#generate よりも人間に読みやすい文字列を返します。

pretty_unparse は将来削除される予定です。

@param object JSON 形式の文字列に変換するオブ...
...options JSON::State または、to_hash や to_h メソッドでハッシュに変換可能なオブジェクトを指定できます。
ハッシュを使用する場合指定可能なオプションは JSON.#generate を参照してください。

//emlist[例][ruby]{
require "json"

hash...
..."tanaka", "age": 19 }
puts JSON.generate(hash)
# => {"name":"tanaka","age":19}

puts JSON.pretty_generate(hash)
# => {
# "name": "tanaka",
# "age": 19
# }

puts JSON.pretty_generate(hash, space: "\t")
# => {
# "name": "tanaka",
# "age": 19
# }
//}

@see JSON.#generate...

JSON.#pretty_unparse(object, options = nil) -> String (51235.0)

Ruby のオブジェクトを JSON 形式の文字列に変換して返します。

...Ruby のオブジェクトを JSON 形式の文字列に変換して返します。

このメソッドは JSON.#generate よりも人間に読みやすい文字列を返します。

pretty_unparse は将来削除される予定です。

@param object JSON 形式の文字列に変換するオブ...
...options JSON::State または、to_hash や to_h メソッドでハッシュに変換可能なオブジェクトを指定できます。
ハッシュを使用する場合指定可能なオプションは JSON.#generate を参照してください。

//emlist[例][ruby]{
require "json"

hash...
..."tanaka", "age": 19 }
puts JSON.generate(hash)
# => {"name":"tanaka","age":19}

puts JSON.pretty_generate(hash)
# => {
# "name": "tanaka",
# "age": 19
# }

puts JSON.pretty_generate(hash, space: "\t")
# => {
# "name": "tanaka",
# "age": 19
# }
//}

@see JSON.#generate...

絞り込み条件を変える

JSON::Ext::Generator::State (51103.0)

Alias of JSON::State

...Alias of JSON::State...

JSON::State (51103.0)

Ruby オブジェクトから JSON 形式の文字列を生成する間、 JSON 形式の文字列を生成するための設定を保持しておくために使用するクラスです。

...Ruby オブジェクトから JSON 形式の文字列を生成する間、
JSON
形式の文字列を生成するための設定を保持しておくために使用するクラスです。...

JSON::State.new(options = {}) -> JSON::State (43189.0)

自身を初期化します。

...字列を指定します。デフォルトは空文字列です。
: :space
JSON
形式の文字列のトークン間に挿入する文字列を指定します。デフォルトは空文字列です。
: :space_before
JSON
形式の文字列中で JavaScript のオブジェクトを表す部分...
...。デフォルトは空文字列です。
: :object_nl
JSON
形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列を指定します。
デフォルトは空文字列です。
: :array_nl
JSON
形式の文字列中に現れる JavaScript の配列...
...ジェクトの循環をチェックします。
この動作がデフォルトです。
: :allow_nan
真を指定した場合、JSON::NaN, JSON::Infinity,
JSON
::MinusInfinity を生成することを許すようになります。
偽を指定した場合、これらの値を生成しよう...

JSON::State#max_nesting -> Integer (42487.0)

生成される JSON 形式の文字列のネストの深さの最大値を返します。

... JSON 形式の文字列のネストの深さの最大値を返します。

この値がゼロである場合は、ネストの深さのチェックを行いません。

//emlist[例 ネストの深さチェックを行う][ruby]{
require "json"

json
_state = JSON::State.new(max_nesting: 2)
json
_s...
...# => 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)
//}...

JSON::State#object_nl -> String (42397.0)

JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列を返します。

...
JSON
形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列を返します。

//emlist[例][ruby]{
require "json"

json
_state = JSON::State.new(object_nl: "")
json
_state.object_nl # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }...
...], json_state)
# => [1,2,{"name":"tanaka","age":19}]

json
_state = JSON::State.new(object_nl: "\n")
json
_state.object_nl # => "\n"
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)

# => [1,2,{
# "name":"tanaka",
# "age":19
# }]
//}...

絞り込み条件を変える

JSON::State#space -> String (42397.0)

JSON 形式の文字列のトークン間に挿入する文字列を返します。

...
JSON
形式の文字列のトークン間に挿入する文字列を返します。

//emlist[例][ruby]{
require "json"

json
_state = JSON::State.new(space: "")
json
_state.space # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age"...
...:19}]

json
_state = JSON::State.new(space: "\t")
json
_state.space # => "\t"
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name": "tanaka","age": 19}]
//}...

JSON::State#space_before -> String (42397.0)

JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の 前に挿入する文字列を返します。

...
JSON
形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の
前に挿入する文字列を返します。

//emlist[例][ruby]{
require "json"

json
_state = JSON::State.new(space_before: "")
json
_state.space_before # => ""
puts JSON.generate([1, 2, { n...
...ame: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]

json
_state = JSON::State.new(space_before: " ")
json
_state.space_before # => " "
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name" :"tanaka","age" :19}]
//}...

JSON::State#configure(options = {}) -> self (42385.0)

与えられたハッシュで自身を設定します。

...ーについては JSON::State.new を参照してください。

@param options このオブジェクトの設定をするためのハッシュを指定します。

//emlist[例][ruby]{
require "json"

json
_state = JSON::State.new(indent: "\t")
json
_state.indent # => "\t"
JSON
.generate({key1: "va...
...lue1", 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#merge(options = {}) -> self (42385.0)

与えられたハッシュで自身を設定します。

...ーについては JSON::State.new を参照してください。

@param options このオブジェクトの設定をするためのハッシュを指定します。

//emlist[例][ruby]{
require "json"

json
_state = JSON::State.new(indent: "\t")
json
_state.indent # => "\t"
JSON
.generate({key1: "va...
...lue1", 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#max_nesting=(depth) (42379.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#object_nl=(string) (42379.0)

JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列をセットします。

...
JSON
形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列をセットします。

@param string JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列を指定します。

//emlist[例][ruby]{
require...
..."json"

json
_state = JSON::State.new(object_nl: "")
json
_state.object_nl # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]

json
_state.object_nl = "\n"
json
_state.object_nl # => "\n"
puts JSON.generate([1, 2, {...
...name: "tanaka", age: 19 }], json_state)
# => [1,2,{
# "name":"tanaka",
# "age":19
# }]
//}...

JSON::State#space=(string) (42379.0)

JSON 形式の文字列のトークン間に挿入する文字列をセットします。

...
JSON
形式の文字列のトークン間に挿入する文字列をセットします。

@param string JSON 形式の文字列のトークン間に挿入する文字列を指定します。

//emlist[例][ruby]{
require "json"

json
_state = JSON::State.new(space: "")
json
_state.space...
...# => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]

json
_state.space = "\t"
json
_state.space # => "\t"
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name": "tanaka","age": 19}]
//}...

JSON::State#space_before=(string) (42379.0)

JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の 前に挿入する文字列をセットします。

...
JSON
形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の
前に挿入する文字列をセットします。

@param string JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の
前に挿入する文字列...
...uire "json"

json
_state = JSON::State.new(space_before: "")
json
_state.space_before # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]

json
_state.space_before = " "
json
_state.space_before # => " "
puts JSON.gene...
...rate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name" :"tanaka","age" :19}]
//}...

JSON::State#array_nl -> String (42289.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#indent=(string) (42277.0)

インデントに使用する文字列をセットします。

...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)
# => "{...

絞り込み条件を変える

JSON::State#array_nl=(str) (42253.0)

JSON の配列の後に出力する文字列をセットします。

...
JSON
の配列の後に出力する文字列をセットします。

//emlist[例][ruby]{
require "json"

json
_state = JSON::State.new({})
json
_state.array_nl # => ""
json
_state.array_nl = "\n"
json
_state.array_nl # => "\n"
//}...

JSON::State#allow_nan? -> bool (42241.0)

NaN, Infinity, -Infinity を生成できる場合、真を返します。 そうでない場合は偽を返します。

...finity を生成できる場合、真を返します。
そうでない場合は偽を返します。

//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? # => true
//}

@see 4627...

JSON::State#check_circular? -> bool (42223.0)

循環参照のチェックを行う場合は、真を返します。 そうでない場合は偽を返します。

...y]{
require "json"

a = [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[0]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
s = JSON.state.new
begin
JSON
.generate(a, s)
rescue JSON::NestingErr...
...or => e
[e, s.max_nesting, s.check_circular?] # => [#<JSON::NestingError: nesting of 100 is too deep>, 100, true]
end
//}

//emlist[例 ネストをチェックしないケース][ruby]{
require "json"

a = [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[...
...[[[[[[[[[[0]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
s2 = JSON.state.new(max_nesting: 0)
json
= JSON.generate(a, s2)
[json, s2.max_nesting, s2.check_circular?] # => ["[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[...

JSON::State#indent -> String (42187.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#to_h -> Hash (42133.0)

自身をハッシュに変換します。

...自身をハッシュに変換します。

//emlist[例][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,...

絞り込み条件を変える

JSON::State#to_hash -> Hash (42133.0)

自身をハッシュに変換します。

...自身をハッシュに変換します。

//emlist[例][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,...

JSON::State#generate(obj) -> String (42103.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#ascii_only? -> bool (42055.0)

ASCII 文字列のみを用いて JSON 形式の文字列を生成する場合に真を返します。 そうでない場合に偽を返します。

...ASCII 文字列のみを用いて JSON 形式の文字列を生成する場合に真を返します。
そうでない場合に偽を返します。...

JSON::State#depth=(depth) (42055.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#[](name) -> object (42007.0)

Return the value returned by method name.

Return the value returned by method name.

絞り込み条件を変える

JSON::State#[]=(name, value) (42007.0)

Set the attribute name to value.

Set the attribute name to value.

JSON::State#buffer_initial_length -> Integer (42007.0)

This integer returns the current initial length of the buffer.

This integer returns the current initial length of the buffer.

JSON::State#buffer_initial_length=(length) (42007.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#depth -> Integer (42007.0)

This integer returns the current depth of data structure nesting.

This integer returns the current depth of data structure nesting.

JSON::State#quirks_mode -> bool (42007.0)

Returns true, if quirks mode is enabled. Otherwise returns false.

Returns true, if quirks mode is enabled. Otherwise returns false.

絞り込み条件を変える

JSON::State#quirks_mode=(enable) (42007.0)

If set to true, enables the quirks_mode mode.

If set to true, enables the quirks_mode mode.

JSON::State#quirks_mode? -> bool (42007.0)

Returns true, if quirks mode is enabled. Otherwise returns false.

Returns true, if quirks mode is enabled. Otherwise returns false.