Class: Inspec::Resources::AuditPolicy
- Inherits:
-
Object
- Object
- Inspec::Resources::AuditPolicy
show all
- Defined in:
- lib/inspec/resources/audit_policy.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method) ⇒ Object
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
# File 'lib/inspec/resources/audit_policy.rb', line 36
def method_missing(method)
key = method.to_s
result ||= inspec.command("Auditpol /get /subcategory:'#{key}' /r").stdout
target = nil
result.each_line do |s|
target = s.strip if s =~ /\b.*#{key}.*\b/
end
values = nil
unless target.nil?
values = target.split(",")[4]
end
values
end
|
Instance Method Details
#to_s ⇒ Object
60
61
62
|
# File 'lib/inspec/resources/audit_policy.rb', line 60
def to_s
"Audit Policy"
end
|