るりまサーチ

最速Rubyリファレンスマニュアル検索!
424件ヒット [1-100件を表示] (0.039秒)

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

検索結果

<< 1 2 3 ... > >>

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

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

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

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

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

JSON::State.from_state(options) -> JSON::State (9338.0)

与えられた options によって生成した JSON::State のインスタンスを返します。

...JSON::State のインスタンスを返します。

@param options JSON::State のインスタンスか、ハッシュを指定します。

@return options がハッシュである場合は、それによって初期化した JSON::State
返します。options が JSON::State のイ...
...ON::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
"js...
...on"

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 (3179.0)

自身を初期化します。

...定][ruby]{
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.cla...
...ss # => JSON::Ext::Generator::State
copy.indent # => "\t"
//}...

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

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

...uby]{
require
"json"

json_state = JSON::State.new(max_nesting: 2)
json_state.max_nesting # => 2
JSON.generate([[]], json_state)
JSON.generate([[[]]], json_state) # => JSON::NestingError
//}

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

json_state = J...
...SON::State.new(max_nesting: 0)
json_state.max_nesting # => 0
JSON.generate([[[[[[[[[[]]]]]]]]]], json_state)
//}...

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

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

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

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

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

json_state = JSON::State.new(indent: "\t")
json_state.indent # => "\t"
JSON.generate({...
...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#merge(options = {}) -> self (3060.0)

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

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

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

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

json_state = JSON::State.new(indent: "\t")
json_state.indent # => "\t"
JSON.generate({...
...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#object_nl -> String (3054.0)

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 (3054.0)

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 (3054.0)

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

...st[例][ruby]{
require
"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 = 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}]
//}...
<< 1 2 3 ... > >>