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.


1496
1497
1498
1499
# File 'lib/puppet/settings.rb', line 1496

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name


1494
1495
1496
# File 'lib/puppet/settings.rb', line 1494

def name
  @name
end

Instance Method Details

#include?(name) ⇒ Boolean

Returns:

  • (Boolean)

1501
1502
1503
# File 'lib/puppet/settings.rb', line 1501

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

#inspectObject


1512
1513
1514
# File 'lib/puppet/settings.rb', line 1512

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

#lookup(name) ⇒ Object


1505
1506
1507
1508
1509
1510
# File 'lib/puppet/settings.rb', line 1505

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