Class: MongodbConf

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

Instance Method Summary collapse

Constructor Details

#initialize(conf_path = nil) ⇒ MongodbConf

Returns a new instance of MongodbConf.



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

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

Instance Method Details

#resource_idObject

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



27
28
29
# File 'lib/inspec-mongodb-resources/resources/mongodb_conf.rb', line 27

def resource_id
  @conf_path || "mongodb_conf"
end