るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.180秒)
トップページ > クエリ:i[x] > クエリ:A[x] > クエリ:on[x] > クエリ:object_nl=[x]

別のキーワード

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

ライブラリ

クラス

検索結果

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

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

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

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

//emlist[例][ruby]{
require...
...son"

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.object_nl = "\n"
json_state.object_nl # => "\n"
puts JSON.generate([1, 2, { nam...
...e: "tanaka", age: 19 }], json_state)
# => [1,2,{
# "name":"tanaka",
# "age":19
# }]
//}...