Class: Puppet::Settings::ValuesFromSection

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, section) ⇒ ValuesFromSection

Returns a new instance of ValuesFromSection.



1404
1405
1406
1407
# File 'lib/puppet/settings.rb', line 1404

def initialize(name, section)
  @name = name
  @section = section
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



1402
1403
1404
# File 'lib/puppet/settings.rb', line 1402

def name
  @name
end

Instance Method Details

#include?(name) ⇒ Boolean

Returns:

  • (Boolean)


1409
1410
1411
# File 'lib/puppet/settings.rb', line 1409

def include?(name)
  !@section.setting(name).nil?
end

#inspectObject



1420
1421
1422
# File 'lib/puppet/settings.rb', line 1420

def inspect
  %Q{<#{self.class}:#{self.object_id} @name="#{@name}" @section="#{@section}">}
end

#lookup(name) ⇒ Object



1413
1414
1415
1416
1417
1418
# File 'lib/puppet/settings.rb', line 1413

def lookup(name)
  setting = @section.setting(name)
  if setting
    setting.value
  end
end