Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

IPAddr#to_json

(?::JSON::State? state) -> ::String
to_json(*a)

Returns a json string containing the IP address representation.

See also #to_i #to_range #succ #to_s also in 4.0 · 3.4