Class: Puppet::Runtime Private
- Includes:
- Singleton
- Defined in:
- lib/puppet/runtime.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.
Provides access to runtime implementations.
Instance Method Summary collapse
-
#[](name) ⇒ Object
private
Get a runtime implementation.
-
#[]=(name, impl) ⇒ Object
private
Register a runtime implementation.
-
#clear ⇒ Object
private
Clears all implementations.
-
#load_services ⇒ Object
private
Loads all runtime implementations.
Instance Method Details
#[](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.
Get a runtime implementation.
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/puppet/runtime.rb', line 41 def [](name) service = @runtime_services[name] raise ArgumentError, "Unknown service #{name}" unless service if service.is_a?(Proc) @runtime_services[name] = service.call else service end end |
#[]=(name, impl) ⇒ 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.
Register a runtime implementation.
57 58 59 |
# File 'lib/puppet/runtime.rb', line 57 def []=(name, impl) @runtime_services[name] = impl end |
#clear ⇒ 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.
Clears all implementations. This is used for testing.
64 65 66 |
# File 'lib/puppet/runtime.rb', line 64 def clear initialize end |
#load_services ⇒ 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.
Loads all runtime implementations.
32 33 34 |
# File 'lib/puppet/runtime.rb', line 32 def load_services @runtime_services.keys.each { |key| self[key] } end |