Class: Inspec::Resources::NtpConf

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

Instance Method Summary collapse

Constructor Details

#initialize(path = nil) ⇒ NtpConf

Returns a new instance of NtpConf.



19
20
21
# File 'lib/resources/ntp_conf.rb', line 19

def initialize(path = nil)
  @conf_path = path || '/etc/ntp.conf'
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name) ⇒ Object



23
24
25
26
27
28
# File 'lib/resources/ntp_conf.rb', line 23

def method_missing(name)
  param = read_params[name.to_s]
  # extract first value if we have only one value in array
  return param[0] if param.is_a?(Array) and param.length == 1
  param
end

Instance Method Details

#to_sObject



30
31
32
# File 'lib/resources/ntp_conf.rb', line 30

def to_s
  'ntp.conf'
end