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


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

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name


1490
1491
1492
# File 'lib/puppet/settings.rb', line 1490

def name
  @name
end

Instance Method Details

#include?(name) ⇒ Boolean


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

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

#inspectObject


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

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

#lookup(name) ⇒ Object


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

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