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

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
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.