to_json(state_or_hash = nil) -> String
自身から生成した JSON 形式の文字列を返します。
例 require "json" person = { "name" => "tanaka", "age" => 19 } person.to_json # => "{\"name\":\"tanaka\",\"age\":19}"
require "json" person = { "name" => "tanaka", "age" => 19 } person.to_json # => "{\"name\":\"tanaka\",\"age\":19}"