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.


1574
1575
1576
1577
# File 'lib/puppet/settings.rb', line 1574

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.


1572
1573
1574
# File 'lib/puppet/settings.rb', line 1572

def name
  @name
end

Instance Method Details

#include?(name) ⇒ Boolean

Returns:

  • (Boolean)

1579
1580
1581
# File 'lib/puppet/settings.rb', line 1579

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

#inspectObject


1590
1591
1592
# File 'lib/puppet/settings.rb', line 1590

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

#lookup(name) ⇒ Object


1583
1584
1585
1586
1587
1588
# File 'lib/puppet/settings.rb', line 1583

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