Skip to content

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

instance method

ObjectSpace#dump_shapes

dump_shapes(output: :file, since: 0)

Dump the contents of the ruby shape tree as JSON.

output argument is the same as for dump.

If since is a positive integer, only shapes newer than the provided shape id are dumped. The current shape_id can be accessed using RubyVM.stat(:next_shape_id).

This method is only expected to work with C Ruby. This is an experimental method and is subject to change. In particular, the function signature and output format are not guaranteed to be compatible in future versions of ruby.

See also #dump_all #garbage_collect #dump also in 4.0 · 3.4 · 3.3 · 3.2