Class: Inspec::Resources::RabbitmqConfig
- Inherits:
-
Object
- Object
- Inspec::Resources::RabbitmqConfig
- Includes:
- FileReader
- Defined in:
- lib/inspec/resources/rabbitmq_config.rb
Instance Method Summary collapse
-
#initialize(conf_path = nil) ⇒ RabbitmqConfig
constructor
A new instance of RabbitmqConfig.
- #params(*opts) ⇒ Object
- #resource_id ⇒ Object
- #to_s ⇒ Object
Methods included from FileReader
Constructor Details
#initialize(conf_path = nil) ⇒ RabbitmqConfig
Returns a new instance of RabbitmqConfig.
20 21 22 23 |
# File 'lib/inspec/resources/rabbitmq_config.rb', line 20 def initialize(conf_path = nil) @conf_path = conf_path || "/etc/rabbitmq/rabbitmq.config" @content = read_file_content(@conf_path, allow_empty: true) end |
Instance Method Details
#params(*opts) ⇒ Object
25 26 27 28 29 |
# File 'lib/inspec/resources/rabbitmq_config.rb', line 25 def params(*opts) opts.inject(read_params) do |res, nxt| res.respond_to?(:key) ? res[nxt] : nil end end |
#resource_id ⇒ Object
35 36 37 |
# File 'lib/inspec/resources/rabbitmq_config.rb', line 35 def resource_id @conf_path end |
#to_s ⇒ Object
31 32 33 |
# File 'lib/inspec/resources/rabbitmq_config.rb', line 31 def to_s "rabbitmq_config #{@conf_path}" end |