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.



1398
1399
1400
# File 'lib/puppet/settings.rb', line 1398

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.



1414
1415
1416
1417
1418
# File 'lib/puppet/settings.rb', line 1414

def conf
  @conf ||= if environments = Puppet.lookup(:environments)
              environments.get_conf(@environment_name)
            end
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)


1402
1403
1404
1405
1406
1407
# File 'lib/puppet/settings.rb', line 1402

def include?(name)
  if Puppet::Settings::EnvironmentConf::VALID_SETTINGS.include?(name) && conf
    return true
  end
  false
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.



1409
1410
1411
1412
# File 'lib/puppet/settings.rb', line 1409

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