method
allocation_method_id
v2_5_5 -
Show latest stable
- Class:
ObjectSpace
allocation_method_id(p1)public
Returns the method identifier for the given object.
class A include ObjectSpace def foo trace_object_allocations do obj = Object.new p "#{allocation_class_path(obj)}##{allocation_method_id(obj)}" end end end A.new.foo #=> "Class#new"
See ::trace_object_allocations for more information and examples.