るりまサーチ

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. matrix i
  5. csv to_i

検索結果

<< 1 2 3 ... > >>

JSON::MinusInfinity -> Float (18402.0)

負の無限大を表します。

負の無限大を表します。

@see Float

JSON::Infinity -> Float (12302.0)

正の無限大を表します。

正の無限大を表します。

@see Float

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

This integer returns the current initial length of the buffer.

...This integer returns the current initial length of the buffer....

JSON::State#indent -> String (6302.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#max_nesting -> Integer (6302.0)

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

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

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

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

json
_state = JSON::State.new(max_nesting: 2)
json
_s...
..._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
.gene...
...rate([[[[[[[[[[]]]]]]]]]], json_state)
//}...

絞り込み条件を変える

JSON.create_id -> String (6202.0)

json_create メソッドで使用するクラスを決定するために使用する値を返します。

...
json
_create メソッドで使用するクラスを決定するために使用する値を返します。

デフォルトは "json_class" です。

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

class User
attr :id, :name
def initialize(id, name)
@id, @name = id, name
end

def self.json_create(...
...new(object['id'], object["name"])
end

def as_json(*)
{
JSON
.create_id => self.class.name,
"id" => id,
"name" => name,
}
end

def to_json(*)
as_json.to_json
end
end

json
= JSON.generate(User.new(1, "tanaka"))
json
# => "{\"json_class\":\"User\",\"id\":1,\"nam...
...e\":\"tanaka\"}"
JSON
.parse(json, create_additions: true)
# => #<User:0x0000557709b269e0 @id=1, @name="tanaka">
//}...

JSON::State#ascii_only? -> bool (6202.0)

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

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

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

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

...//emlist[例 ネストをチェックするケース][ruby]{
require "json"

a = [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[0]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
s = JSON.stat...
...e.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#configure(options = {}) -> self (6202.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#quirks_mode -> bool (6202.0)

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

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

絞り込み条件を変える

<< 1 2 3 ... > >>