Class: Inspec::Resources::MongodbConf

Inherits:
JsonConfig
  • Object
show all
Defined in:
lib/inspec/resources/mongodb_conf.rb

Instance Attribute Summary

Attributes inherited from JsonConfig

#params, #raw_content

Instance Method Summary collapse

Methods inherited from JsonConfig

#method_missing, #to_s, #value

Methods included from FileReader

#read_file_content

Methods included from ObjectTraverser

#extract_value

Constructor Details

#initialize(conf_path = nil) ⇒ MongodbConf

Returns a new instance of MongodbConf.



17
18
19
20
21
22
23
24
25
# File 'lib/inspec/resources/mongodb_conf.rb', line 17

def initialize(conf_path = nil)
  @conf_path = conf_path || inspec.mongodb.conf_path

  if @conf_path.nil?
    return skip_resource "MongoDB conf path is not set."
  end

  super(@conf_path)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Inspec::Resources::JsonConfig

Instance Method Details

#resource_idObject

set resource_id to “” if system is not able to determine the @conf_path



28
29
30
# File 'lib/inspec/resources/mongodb_conf.rb', line 28

def resource_id
  @conf_path || "mongodb_conf"
end