るりまサーチ

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

別のキーワード

  1. _builtin each_object
  2. objectspace each_object
  3. json object
  4. pp object_group
  5. object send

ライブラリ

クラス

モジュール

キーワード

検索結果

JSON::State#object_nl -> String (18226.0)

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

...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_state.object_nl # => "\n"
puts JSON.ge...

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

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

...をセットします。

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

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

json_state = JSON::State.new(object_nl: "")
json_state.object_nl # => ""
puts JSON.g...
...enerate([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, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{
# "name":"tanaka",
# "age":19
# }]
//}...

JSON.#generate(object, state = nil) -> String (132.0)

与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。

...文字列です。
: :space
a string that is put after, a : or , delimiter (default: '')
: :space_before
a string that is put before a : pair delimiter (default: '')
: :object_nl
a string that is put at the end of a JSON object (default: '')
: :array_nl
a string that is put at the end of a J...

JSON.#unparse(object, state = nil) -> String (132.0)

与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。

...文字列です。
: :space
a string that is put after, a : or , delimiter (default: '')
: :space_before
a string that is put before a : pair delimiter (default: '')
: :object_nl
a string that is put at the end of a JSON object (default: '')
: :array_nl
a string that is put at the end of a J...