Class: Puppet::Environments::Static Private
- Includes:
- EnvironmentCreator, EnvironmentLoader
- Defined in:
- lib/puppet/environments.rb
Overview
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.
A source of pre-defined environments.
Direct Known Subclasses
Instance Method Summary collapse
-
#get(name) ⇒ Puppet::Node::Environment?
private
Find a named environment.
-
#get_conf(name) ⇒ Puppet::Setting::EnvironmentConf?
private
Returns a basic environment configuration object tied to the environment’s implementation values.
-
#initialize(*environments) ⇒ Static
constructor
private
A new instance of Static.
-
#list ⇒ Array<Puppet::Node::Environment>
private
All of the environments known to the loader.
-
#search_paths ⇒ Array<String>
private
A list of indicators of where the loader is getting its environments from.
Methods included from EnvironmentLoader
#clear_all, #get!, #guard, #unguard
Methods included from EnvironmentCreator
Constructor Details
#initialize(*environments) ⇒ Static
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 Static.
96 97 98 |
# File 'lib/puppet/environments.rb', line 96 def initialize(*environments) @environments = environments end |
Instance Method Details
#get(name) ⇒ Puppet::Node::Environment?
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.
Find a named environment
111 112 113 114 115 |
# File 'lib/puppet/environments.rb', line 111 def get(name) @environments.find do |env| env.name == name.intern end end |
#get_conf(name) ⇒ Puppet::Setting::EnvironmentConf?
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 basic environment configuration object tied to the environment’s implementation values. Will not interpolate.
Attempt to obtain the initial configuration for the environment. Not all loaders can provide this.
121 122 123 124 125 126 127 128 |
# File 'lib/puppet/environments.rb', line 121 def get_conf(name) env = get(name) if env Puppet::Settings::EnvironmentConf.static_for(env, Puppet[:environment_timeout], Puppet[:static_catalogs], Puppet[:rich_data]) else nil end end |
#list ⇒ Array<Puppet::Node::Environment>
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 All of the environments known to the loader.
106 107 108 |
# File 'lib/puppet/environments.rb', line 106 def list @environments end |
#search_paths ⇒ Array<String>
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.
A list of indicators of where the loader is getting its environments from.
101 102 103 |
# File 'lib/puppet/environments.rb', line 101 def search_paths ["data:text/plain,internal"] end |