Class: Inspec::Resources::RabbitmqConf
- Inherits:
-
Object
- Object
- Inspec::Resources::RabbitmqConf
- Includes:
- FileReader
- Defined in:
- lib/resources/rabbitmq_conf.rb
Instance Method Summary collapse
-
#initialize(conf_path = nil) ⇒ RabbitmqConf
constructor
A new instance of RabbitmqConf.
- #params(*opts) ⇒ Object
- #to_s ⇒ Object
Methods included from FileReader
Constructor Details
#initialize(conf_path = nil) ⇒ RabbitmqConf
Returns a new instance of RabbitmqConf.
21 22 23 24 |
# File 'lib/resources/rabbitmq_conf.rb', line 21 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
26 27 28 29 30 |
# File 'lib/resources/rabbitmq_conf.rb', line 26 def params(*opts) opts.inject(read_params) do |res, nxt| res.respond_to?(:key) ? res[nxt] : nil end end |
#to_s ⇒ Object
32 33 34 |
# File 'lib/resources/rabbitmq_conf.rb', line 32 def to_s "rabbitmq_config #{@conf_path}" end |