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


122
123
124
# File 'lib/puppet/settings/ini_file.rb', line 122

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.


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

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.


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

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