Skip to content

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

class method

ObjectSpace.allocation_sourceline

allocation_sourceline(object) → integer

Returns the original line from source for from the given object.

See ::trace_object_allocations for more information and examples.