Class: Hwloc::Struct

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/hwloc/Obj.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object



58
59
60
61
62
63
64
# File 'lib/hwloc/Obj.rb', line 58

def method_missing(m, *args, &block)
  begin
    return self[m]
  rescue
    super
  end
end

Instance Attribute Details

#topologyObject (readonly)

Returns the value of attribute topology.



72
73
74
# File 'lib/hwloc/Obj.rb', line 72

def topology
  @topology
end

Instance Method Details

#[](symbol) ⇒ Object



66
67
68
69
70
# File 'lib/hwloc/Obj.rb', line 66

def [](symbol)
  o = super
  o.instance_variable_set(:@topology, @topology) if o.kind_of?(Hwloc::Struct) || o.kind_of?(Hwloc::Union)
  return o
end