るりまサーチ

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

別のキーワード

  1. _builtin to_h
  2. hash to_h
  3. env to_h
  4. struct to_h
  5. array to_h

ライブラリ

モジュール

キーワード

検索結果

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"

h
ash = { "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"

h
ash = { "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...