44件ヒット
[1-44件を表示]
(0.121秒)
検索結果
先頭4件
-
JSON
. # unparse(object , state = nil) -> String (15114.0) -
与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。
...sInfinity を生成することもありません。
unparse は将来削除される予定です。
@param object JSON 形式の文字列に変換するオブジェクトを指定します。
@param state JSON::State または、to_hash や to_h メソッドでハッシュに変換可能なオ......ring 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 JSON array (default: '')
: :check_c... -
JSON
. # pretty _ unparse(object , options = nil) -> String (3114.0) -
Ruby のオブジェクトを JSON 形式の文字列に変換して返します。
...読みやすい文字列を返します。
pretty_unparse は将来削除される予定です。
@param object JSON 形式の文字列に変換するオブジェクトを指定します。
@param options JSON::State または、to_hash や to_h メソッドでハッシュに変換可能なオブ......。
//emlist[例][ruby]{
require "json"
hash = { "name": "tanaka", "age": 19 }
puts JSON.generate(hash)
# => {"name":"tanaka","age":19}
puts JSON.pretty_generate(hash)
# => {
# "name": "tanaka",
# "age": 19
# }
puts JSON.pretty_generate(hash, space: "\t")
# => {
# "name": "tan... -
JSON
. # generate(object , state = nil) -> String (14.0) -
与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。
...sInfinity を生成することもありません。
unparse は将来削除される予定です。
@param object JSON 形式の文字列に変換するオブジェクトを指定します。
@param state JSON::State または、to_hash や to_h メソッドでハッシュに変換可能なオ......ring 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 JSON array (default: '')
: :check_c... -
JSON
. # pretty _ generate(object , options = nil) -> String (14.0) -
Ruby のオブジェクトを JSON 形式の文字列に変換して返します。
...読みやすい文字列を返します。
pretty_unparse は将来削除される予定です。
@param object JSON 形式の文字列に変換するオブジェクトを指定します。
@param options JSON::State または、to_hash や to_h メソッドでハッシュに変換可能なオブ......。
//emlist[例][ruby]{
require "json"
hash = { "name": "tanaka", "age": 19 }
puts JSON.generate(hash)
# => {"name":"tanaka","age":19}
puts JSON.pretty_generate(hash)
# => {
# "name": "tanaka",
# "age": 19
# }
puts JSON.pretty_generate(hash, space: "\t")
# => {
# "name": "tan...