Class: Inspec::Resources::AuditDaemonConf
- Inherits:
-
Object
- Object
- Inspec::Resources::AuditDaemonConf
- Includes:
- FileReader
- Defined in:
- lib/inspec/resources/auditd_conf.rb
Instance Attribute Summary collapse
-
#conf_path ⇒ Object
readonly
Returns the value of attribute conf_path.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(path = nil) ⇒ AuditDaemonConf
constructor
A new instance of AuditDaemonConf.
- #method_missing(name) ⇒ Object
- #resource_id ⇒ Object
- #to_s ⇒ Object
Methods included from FileReader
Constructor Details
#initialize(path = nil) ⇒ AuditDaemonConf
Returns a new instance of AuditDaemonConf.
21 22 23 24 |
# File 'lib/inspec/resources/auditd_conf.rb', line 21 def initialize(path = nil) @conf_path = path || "/etc/audit/auditd.conf" @content = read_file_content(@conf_path) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name) ⇒ Object
26 27 28 |
# File 'lib/inspec/resources/auditd_conf.rb', line 26 def method_missing(name) read_params[name.to_s] end |
Instance Attribute Details
#conf_path ⇒ Object (readonly)
Returns the value of attribute conf_path.
19 20 21 |
# File 'lib/inspec/resources/auditd_conf.rb', line 19 def conf_path @conf_path end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
19 20 21 |
# File 'lib/inspec/resources/auditd_conf.rb', line 19 def content @content end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
19 20 21 |
# File 'lib/inspec/resources/auditd_conf.rb', line 19 def params @params end |
Instance Method Details
#resource_id ⇒ Object
30 31 32 |
# File 'lib/inspec/resources/auditd_conf.rb', line 30 def resource_id @conf_path || "auditd_conf" end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/inspec/resources/auditd_conf.rb', line 34 def to_s "Audit Daemon Config" end |