Ruby 4.0 リファレンスマニュアル

module JSON::Generator::GeneratorMethods::Integer

[edit]

aliases: JSON::Ext::Generator::GeneratorMethods::Integer

要約

Integer に JSON で使用するインスタンスメソッドを追加するためのモジュールです。

目次

インスタンスメソッド

インスタンスメソッド

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 10.to_json # => "10"