るりまサーチ

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

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method gets
  4. irb/input-method new
  5. matrix -

検索結果

<< 1 2 3 ... > >>

JSON::State.from_state(options) -> JSON::State (9302.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 -> JSON::Ext::Generator::State (6302.0)

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

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

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

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

JSON::State.new(options = {}) -> JSON::State (3202.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#allow_nan? -> bool (3118.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 (3102.0)

Return the value returned by method name.

Return the value returned by method name.

絞り込み条件を変える

JSON::State#array_nl -> String (3102.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 (3102.0)

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

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

JSON::State#buffer_initial_length -> Integer (3102.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 (3102.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#configure(options = {}) -> self (3102.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...

絞り込み条件を変える

<< 1 2 3 ... > >>