るりまサーチ

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

別のキーワード

  1. optparse on
  2. optionparser on
  3. tracer on
  4. socket udp_server_loop_on
  5. thread abort_on_exception

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 > >>

JSON::State#generate(obj) -> String (21102.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.

...
Generate
s 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....

RDoc::Generator::JsonIndex#generate -> () (21102.0)

解析した情報を RDoc::Generator::JsonIndex::SEARCH_INDEX_FILE に出 力します。

...解析した情報を RDoc::Generator::JsonIndex::SEARCH_INDEX_FILE に出
力します。...

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

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

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

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

//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.configure(indent: " ")
json_state.indent # => " "
JSON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{ \"key1\":\"value1\", \"key2\":\"value2\"}"
//}

@see JSON::State.new...

Kernel#JSON(object, options = {}) -> object (6219.0)

第一引数に与えられたオブジェクトの種類によって Ruby のオブジェクトか JSON 形式の文字列を返します。

...トか JSON 形式の文字列を返します。

第一引数に文字列のようなオブジェクトを指定した場合は、それを JSON.#parse を用いてパースした結果を返します。
そうでないオブジェクトを指定した場合は、それを JSON.#generate を用い...
...ジェクトを指定します。

@param options JSON.#parse, JSON.#generate に渡すオプションを指定します。

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

JSON('[1,2,{"name":"tanaka","age":19}]')
# => [1, 2, {"name"=>"tanaka", "age"=>19}]

JSON('[1,2,{"name":"tanaka","age":19}]', symbolize_na...
...mes: true)
# => [1, 2, {:name=>"tanaka", :age=>19}]
//}

@see JSON.#parse, JSON.#generate...

WEBrick::HTTPRequest#continue (6117.0)

@todo 1.9.3 Generate HTTP/1.1 100 continue response if the client expects it, otherwise does nothing.

...@todo 1.9.3
Generate
HTTP/1.1 100 continue response if the client expects it,
otherwise does nothing....

絞り込み条件を変える

JSON::State#merge(options = {}) -> self (6113.0)

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

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

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

//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.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 -> Integer (3019.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#check_circular? -> bool (3013.0)

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

...]{
require "json"

a = [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[0]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
s = JSON.state.new
begin
JSON.generate(a, s)
rescue JSON::NestingErro...
...r => 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) (3013.0)

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

...uby]{
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)
# => "{...
<< 1 2 3 > >>