るりまサーチ

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

別のキーワード

  1. _builtin windows_31j
  2. encoding windows_31j
  3. _builtin cswindows31j
  4. encoding cswindows31j
  5. json j

ライブラリ

クラス

検索結果

JSON::State#indent=(string) (21113.0)

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

...list[例][ruby]{
require "json"

j
son_state = JSON::State.new(indent: "\t")
j
son_state.indent # => "\t"
J
SON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{\t\"key1\":\"value1\",\t\"key2\":\"value2\"}"
j
son_state.indent = " "
J
SON.generate({key1: "value1", key2: "value2"}, json_state...