Class: Puppet::Environments::Combined Private
- Includes:
- 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.
Combine together multiple loaders to act as one.
Instance Method Summary collapse
- #clear_all ⇒ Object private
-
#get(name) ⇒ Puppet::Node::Environment?
private
Find a named environment.
-
#get_conf(name) ⇒ Puppet::Setting::EnvironmentConf?
private
Attempt to obtain the initial configuration for the environment.
-
#initialize(*loaders) ⇒ Combined
constructor
private
A new instance of Combined.
-
#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
Constructor Details
#initialize(*loaders) ⇒ Combined
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 Combined.
237 238 239 |
# File 'lib/puppet/environments.rb', line 237 def initialize(*loaders) @loaders = loaders end |
Instance Method Details
#clear_all ⇒ 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.
271 272 273 |
# File 'lib/puppet/environments.rb', line 271 def clear_all @loaders.each {|loader| loader.clear_all} end |
#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
252 253 254 255 256 257 258 259 |
# File 'lib/puppet/environments.rb', line 252 def get(name) @loaders.each do |loader| if env = loader.get(name) return env end end nil 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.
Attempt to obtain the initial configuration for the environment. Not all loaders can provide this.
262 263 264 265 266 267 268 269 |
# File 'lib/puppet/environments.rb', line 262 def get_conf(name) @loaders.each do |loader| if conf = loader.get_conf(name) return conf end end nil 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.
247 248 249 |
# File 'lib/puppet/environments.rb', line 247 def list @loaders.collect(&:list).flatten 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.
242 243 244 |
# File 'lib/puppet/environments.rb', line 242 def search_paths @loaders.collect(&:search_paths).flatten end |