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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Cbe7850e7be4bc3b288412f7cf7b019b?d=identicon&s=25 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 = Object.new
      p "#{ObjectSpace::allocation_class_path(obj)}"
    end
  endend
A.new.foo #=> "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
updated.


Thanks
This topic is locked and can not be replied to.