Class: WmiLite::Wmi

### Home Classes Methods

### In Files

- lib/wmi-lite/wmi.rb
- lib/wmi-lite/wmi_instance.rb

### Parent

Object

### Namespace

- CLASS WmiLite::Wmi::Instance

### Methods

- ::new
- #first_of
- #instances_of
- #query

### Class/Module Index

Quicksearch

- WmiLite
- WmiLite::Wmi
- WmiLite::Wmi::Instance
- WmiLite::WmiException

No matching classes.

# WmiLite::Wmi

### Public Class Methods

new(namespace = nil) click to toggle source

    # File lib/wmi-lite/wmi.rb, line 25
    def initialize(namespace = nil)
      @namespace = namespace.nil? ? 'root/cimv2' : namespace
      @connection = nil
    end

### Public Instance Methods

first_of(wmi_class) click to toggle source

    # File lib/wmi-lite/wmi.rb, line 38
    def first_of(wmi_class)
      query_result = start_query("select * from #{wmi_class}", wmi_class)
      first_result = nil
      query_result.each do | record |
        first_result = record
        break
      end
      first_result.nil? ? nil : wmi_result_to_snapshot(first_result)
    end

instances_of(wmi_class) click to toggle source

    # File lib/wmi-lite/wmi.rb, line 34
    def instances_of(wmi_class)
      query_with_context("select * from #{wmi_class}", wmi_class)
    end

query(wql_query) click to toggle source

    # File lib/wmi-lite/wmi.rb, line 30
    def query(wql_query)
      query_with_context(wql_query)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.