Sha256: 77dda08eee8b912e689ede93036fa747b39b6a9ee2f9e36582cce2552c030298

Contents?: true

Size: 724 Bytes

Versions: 5

Compression:

Stored size: 724 Bytes

Contents

# frozen_string_literal: true

module Libvirt
  class NodeInfo
    def initialize(node_info_ptr)
      @node_info_ptr = node_info_ptr
      @node_info_struct = FFI::NodeInfo::Struct.new(node_info_ptr)
    end

    def [](attr)
      @node_info_struct[attr]
    end

    def model
      @node_info_struct[:model].to_s
    end

    def cpus
      @node_info_struct[:cpus]
    end

    def mhz
      @node_info_struct[:mhz]
    end

    def nodes
      @node_info_struct[:nodes]
    end

    def sockets
      @node_info_struct[:sockets]
    end

    def cores
      @node_info_struct[:cores]
    end

    def threads
      @node_info_struct[:threads]
    end

    def memory
      @node_info_struct[:memory]
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
libvirt_ffi-0.4.1 lib/libvirt/node_info.rb
libvirt_ffi-0.4.0 lib/libvirt/node_info.rb
libvirt_ffi-0.3.0 lib/libvirt/node_info.rb
libvirt_ffi-0.2.1 lib/libvirt/node_info.rb
libvirt_ffi-0.2.0 lib/libvirt/node_info.rb