Class: Hwloc::BoolStruct

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



108
109
110
111
112
113
114
# File 'lib/hwloc/Obj.rb', line 108

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

Instance Attribute Details

#topologyObject (readonly)

Returns the value of attribute topology.



126
127
128
# File 'lib/hwloc/Obj.rb', line 126

def topology
  @topology
end

Instance Method Details

#eachObject



116
117
118
119
120
121
122
123
124
# File 'lib/hwloc/Obj.rb', line 116

def each
  if block_given? then
    members.each { |m|
      yield m, (self[m] ==1)
    }
  else
    to_enum(:each)
  end
end