Class: Puppet::Settings::ValuesFromEnvironmentConf Private

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/settings.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(environment_name) ⇒ ValuesFromEnvironmentConf

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ValuesFromEnvironmentConf.



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

def initialize(environment_name)
  @environment_name = environment_name
end

Instance Method Details

#confObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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

def conf
  unless @conf
    environments = Puppet.lookup(:environments) { nil }
    @conf = environments.get_conf(@environment_name) if environments
  end
  @conf
end

#include?(name) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


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

def include?(name)
  if Puppet::Settings::EnvironmentConf::VALID_SETTINGS.include?(name) && conf
    return true
  end

  false
end

#inspectObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



1606
1607
1608
# File 'lib/puppet/settings.rb', line 1606

def inspect
  %Q(<#{self.class}:#{object_id} @environment_name="#{@environment_name}" @conf="#{@conf}">)
end

#lookup(name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



1592
1593
1594
1595
1596
# File 'lib/puppet/settings.rb', line 1592

def lookup(name)
  return nil unless Puppet::Settings::EnvironmentConf::VALID_SETTINGS.include?(name)

  conf.send(name) if conf
end

#nameObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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

def name
  @environment_name
end