Class: Inspec::Resources::MysqlConfEntry

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

Instance Method Summary collapse

Constructor Details

#initialize(path, params) ⇒ MysqlConfEntry

Returns a new instance of MysqlConfEntry.



11
12
13
14
# File 'lib/inspec/resources/mysql_conf.rb', line 11

def initialize(path, params)
  @params = params
  @path = path
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *_) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/inspec/resources/mysql_conf.rb', line 16

def method_missing(name, *_)
  k = name.to_s
  res = @params[k]
  return true if res.nil? && @params.key?(k)

  @params[k]
end

Instance Method Details

#to_sObject



24
25
26
# File 'lib/inspec/resources/mysql_conf.rb', line 24

def to_s
  "MySQL Config entry [#{@path.join(" ")}]"
end