Class: Inspec::Resources::CassandradbConf
- Inherits:
-
JsonConfig
- Object
- JsonConfig
- Inspec::Resources::CassandradbConf
- Defined in:
- lib/inspec/resources/cassandradb_conf.rb
Instance Attribute Summary
Attributes inherited from JsonConfig
Instance Method Summary collapse
-
#initialize(conf_path = nil) ⇒ CassandradbConf
constructor
A new instance of CassandradbConf.
-
#resource_id ⇒ Object
if system unables to determine the cassandra conf path the @conf_path can be nil so in that case sending “” string as resource_id.
Methods inherited from JsonConfig
#method_missing, #to_s, #value
Methods included from FileReader
Methods included from ObjectTraverser
Constructor Details
#initialize(conf_path = nil) ⇒ CassandradbConf
Returns a new instance of CassandradbConf.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/inspec/resources/cassandradb_conf.rb', line 16 def initialize(conf_path = nil) cassandra = nil if conf_path.nil? cassandra = inspec.cassandra @conf_path = cassandra.conf_path else @conf_path = conf_path end if cassandra && cassandra.resource_failed? raise cassandra. elsif @conf_path.nil? return skip_resource "Cassandra db 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_id ⇒ Object
if system unables to determine the cassandra conf path the @conf_path can be nil so in that case sending “” string as resource_id
35 36 37 |
# File 'lib/inspec/resources/cassandradb_conf.rb', line 35 def resource_id @conf_path || "cassandradb_conf" end |