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.


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

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name


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

def name
  @name
end

Instance Method Details

#include?(name) ⇒ Boolean

Returns:

  • (Boolean)

1515
1516
1517
# File 'lib/puppet/settings.rb', line 1515

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

#inspectObject


1526
1527
1528
# File 'lib/puppet/settings.rb', line 1526

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

#lookup(name) ⇒ Object


1519
1520
1521
1522
1523
1524
# File 'lib/puppet/settings.rb', line 1519

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