to_json(state_or_hash = nil) -> StringRuby 1.9.3 から[permalink][rdoc][edit]-
自身から生成した JSON 形式の文字列を返します。
- [PARAM]
state_or_hash: - 生成する JSON 形式の文字列をカスタマイズするために JSON::State のインスタンスか、 JSON::State.new の引数と同じ Hash を指定します。
require "json" p (1.0).to_json # => "1.0" - [PARAM]