本文簡要介紹ruby語言中  ObjectSpace.allocation_class_path  的用法。
用法
allocation_class_path(object) → string
返回給定 object 的類。
class A
  def foo
    ObjectSpace::trace_object_allocations do
      obj = Object.new
      p "#{ObjectSpace::allocation_class_path(obj)}"
    end
  end
end
A.new.foo #=> "Class"
有關更多信息和示例,請參閱 ::trace_object_allocations 。
相關用法
- Ruby ObjectSpace.allocation_generation用法及代碼示例
 - Ruby ObjectSpace.allocation_method_id用法及代碼示例
 - Ruby ObjectSpace.memsize_of_all用法及代碼示例
 - Ruby ObjectSpace.count_symbols用法及代碼示例
 - Ruby ObjectSpace.define_finalizer用法及代碼示例
 - Ruby ObjectSpace.count_imemo_objects用法及代碼示例
 - Ruby ObjectSpace.each_object用法及代碼示例
 - Ruby ObjectSpace.reachable_objects_from用法及代碼示例
 - Ruby ObjectSpace.count_objects_size用法及代碼示例
 - Ruby ObjectSpace.count_nodes用法及代碼示例
 - Ruby ObjectSpace.trace_object_allocations用法及代碼示例
 - Ruby ObjectSpace.count_objects用法及代碼示例
 - Ruby ObjectSpace.count_tdata_objects用法及代碼示例
 - Ruby ObjectSpace模塊用法及代碼示例
 - Ruby Object.instance_variable_get用法及代碼示例
 - Ruby Object.display用法及代碼示例
 - Ruby Object.remove_instance_variable用法及代碼示例
 - Ruby Object.define_singleton_method用法及代碼示例
 - Ruby Object.methods用法及代碼示例
 - Ruby Object.public_send用法及代碼示例
 - Ruby Object.xmp用法及代碼示例
 - Ruby Object.singleton_methods用法及代碼示例
 - Ruby Object.enum_for用法及代碼示例
 - Ruby Object.freeze用法及代碼示例
 - Ruby Object.inspect用法及代碼示例
 
注:本文由純淨天空篩選整理自ruby-lang.org大神的英文原創作品 ObjectSpace.allocation_class_path。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
