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.



1598
1599
1600
1601
# File 'lib/puppet/settings.rb', line 1598

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



1596
1597
1598
# File 'lib/puppet/settings.rb', line 1596

def name
  @name
end

Instance Method Details

#include?(name) ⇒ Boolean

Returns:

  • (Boolean)


1603
1604
1605
# File 'lib/puppet/settings.rb', line 1603

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

#inspectObject



1614
1615
1616
# File 'lib/puppet/settings.rb', line 1614

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

#lookup(name) ⇒ Object



1607
1608
1609
1610
1611
1612
# File 'lib/puppet/settings.rb', line 1607

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