るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.010秒)
トップページ > バージョン:2.6.0[x] > クラス:JSON::State[x] > クエリ:indent=[x]

別のキーワード

  1. prettyprint indent
  2. json indent=
  3. json indent
  4. state indent=
  5. state indent

ライブラリ

検索結果

JSON::State#indent=(string) (54322.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\":\"value1\",\t\"key2\"...