Method: Inspec::Resources::WMI#initialize

Defined in:
lib/inspec/resources/wmi.rb

#initialize(wmiclass = nil, opts = nil) ⇒ WMI

Returns a new instance of WMI.



26
27
28
29
30
31
32
33
34
# File 'lib/inspec/resources/wmi.rb', line 26

def initialize(wmiclass = nil, opts = nil)
  @options = opts || {}
  if wmiclass.is_a?(Hash)
    @options.merge!(wmiclass)
  else
    Inspec.deprecate(:wmi_non_hash_usage, "Using `wmi('wmisclass')` is deprecated. Please use`wmi({class: 'wmisclass'})`")
    @options[:class] = wmiclass
  end
end