Flowdock
method

allocation_method_id

Importance_1
v2_5_5 - Show latest stable - 0 notes - 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.

Show source
Register or log in to add new notes.