Class: Inspec::Resources::OSResource

Inherits:
Object
  • Object
show all
Defined in:
lib/resources/os.rb

Instance Method Summary collapse

Instance Method Details

#[](name) ⇒ Object



30
31
32
33
34
# File 'lib/resources/os.rb', line 30

def [](name)
  # convert string to symbol
  name = name.to_sym if name.is_a? String
  inspec.backend.os[name]
end

#paramsObject

helper to collect a hash object easily



45
46
47
48
49
50
51
52
# File 'lib/resources/os.rb', line 45

def params
  {
    name: inspec.backend.os[:name],
    family: inspec.backend.os[:family],
    release: inspec.backend.os[:release],
    arch: inspec.backend.os[:arch],
  }
end

#to_sObject



54
55
56
# File 'lib/resources/os.rb', line 54

def to_s
  'Operating System Detection'
end