るりまサーチ

最速Rubyリファレンスマニュアル検索!
216件ヒット [101-200件を表示] (0.075秒)
トップページ > クエリ:Ruby[x] > 種類:インスタンスメソッド[x] > クエリ:ruby[x] > クエリ:require[x] > クラス:JSON::State[x]

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

キーワード

検索結果

<< < 1 2 3 > >>

JSON::State#indent -> String (20.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#indent=(string) (20.0)

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

...文字列をセットします。

@param string インデントに使用する文字列を指定します。

//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\":\"v...

JSON::State#max_nesting=(depth) (20.0)

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

...します。

この値にゼロをセットすると、ネストの深さのチェックを行いません。

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

json_state = JSON::State.new(max_nesting: 2)
json_state.max_nesting # => 2
JSON.generate([[]], json_state)
json_state.max_nesting = 3
json_s...

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

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

...用するハッシュのキーについては JSON::State.new を参照してください。

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

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

json_state = JSON::State.new(indent: "\t")
json_state.indent # => "\...
...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 (20.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_sta...

絞り込み条件を変える

JSON::State#object_nl=(string) (20.0)

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

...文字列中に現れる 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_stat...

JSON::State#space -> String (20.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...

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

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

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

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

...します。

//emlist[例][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: " ")
jso...
<< < 1 2 3 > >>