Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Struct#to_json

to_json(*args)

Stores class name (Struct) with Struct values v as a JSON string. Only named structs are supported.

See also #to_h #to_s #to_a #values also in 4.0 · 3.4 · 3.3 · 3.2 · 3.0