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



98
99
100
101
102
103
104
# File 'lib/hwloc/Obj.rb', line 98

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.



116
117
118
# File 'lib/hwloc/Obj.rb', line 116

def topology
  @topology
end

Instance Method Details

#eachObject



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

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