Class: Puppet::Settings::IniFile::Manipulator Private

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/settings/ini_file.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Manipulator

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Manipulator.



124
125
126
# File 'lib/puppet/settings/ini_file.rb', line 124

def initialize(config)
  @config = config
end

Instance Method Details

#delete(section_name, name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



137
138
139
140
141
142
143
# File 'lib/puppet/settings/ini_file.rb', line 137

def delete(section_name, name)
  setting = @config.setting(section_name, name)
  if setting
    @config.delete(section_name, name)
    setting.to_s.chomp
  end
end

#set(section, name, value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



128
129
130
131
132
133
134
135
# File 'lib/puppet/settings/ini_file.rb', line 128

def set(section, name, value)
  setting = @config.setting(section, name)
  if setting
    setting.value = value
  else
    add_setting(section, name, value)
  end
end