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.



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

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

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



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

def name
  @name
end

#settingsObject

Returns the value of attribute settings

Returns:

  • (Object)

    the current value of settings



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

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.



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

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.



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

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