Forum: Ruby on Rails ObjectSpace#allocation_class_path not working as expected

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Rajeev Bharshetty (Guest)
on 2014-06-12 12:23
(Received via mailing list)
Using Ruby Version 2.1.2

class A
  def foo
    ObjectSpace::trace_object_allocations do
      obj =
      p "#{ObjectSpace::allocation_class_path(obj)}"
  endend #=> "Class"

The above method is expected to return back the allocation class path of
the object.
But I am getting an empty string back instead of "Class".
Is it an implementation bug in the method or the documentation is not

This topic is locked and can not be replied to.