Method: Hwloc::Topology#get_obj_by_type
- Defined in:
- lib/hwloc/Topology.rb
#get_obj_by_type(type, idx) ⇒ Object
413 414 415 416 417 418 |
# File 'lib/hwloc/Topology.rb', line 413 def get_obj_by_type(type, idx) depth = get_type_depth(type) return nil if depth == Hwloc::TYPE_DEPTH_UNKNOWN return each_obj.select{ |e| e.type == type }[idx] if depth == Hwloc::TYPE_DEPTH_MULTIPLE return get_obj_by_depth(depth, idx) end |