るりまサーチ

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

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

モジュール

検索結果

JSON.#dump(object, io = nil, limit = nil) -> String | IO (18162.0)

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

...す。

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

JSON.dump({ name: "tanaka", age: 19 }) # => "{\"name\":\"tanaka\",\"age\":19}"
//}

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

File.open("test.txt", "w") do |f|
JSON.dump([[[[[[[[[[]]]]]]]]]], f, 10) # => #<File:test.txt>
JSON.dump([[[[[[[[[[[]]]]]]]]]]],...
...f, 10) # => exceed depth limit (ArgumentError)
end
//}

@see Marshal, Marshal.#dump...