Class: Puppet::Settings::ConfigFile::Section Private

Inherits:
Struct
  • Object
show all
Defined in:
lib/puppet/settings/config_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 Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Section

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 Section


57
58
59
# File 'lib/puppet/settings/config_file.rb', line 57

def initialize(name)
  super(name, [])
end

Instance Attribute Details

#nameObject

Returns the value of attribute name


56
57
58
# File 'lib/puppet/settings/config_file.rb', line 56

def name
  @name
end

#settingsObject

Returns the value of attribute settings


56
57
58
# File 'lib/puppet/settings/config_file.rb', line 56

def settings
  @settings
end

Instance Method Details

#setting(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.


66
67
68
# File 'lib/puppet/settings/config_file.rb', line 66

def setting(name)
  settings.find { |setting| setting.name == name }
end

#with_setting(name, value, meta) ⇒ 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.


61
62
63
64
# File 'lib/puppet/settings/config_file.rb', line 61

def with_setting(name, value, meta)
  settings << Setting.new(name, value, meta)
  self
end