Class: Puppet::Pops::Binder::BindingsComposer::SchemeHandlerHelper
- Defined in:
- lib/puppet/pops/binder/bindings_composer.rb
Constant Summary collapse
- T =
Types::TypeFactory
- HASH_OF_HANDLER =
T.hash_of(T.type_of(Puppet::Plugins::BindingSchemes::BINDINGS_SCHEMES_TYPE))
Instance Method Summary collapse
- #[](scheme) ⇒ Object
-
#initialize(scope) ⇒ SchemeHandlerHelper
constructor
A new instance of SchemeHandlerHelper.
- #load_schemes ⇒ Object
Constructor Details
#initialize(scope) ⇒ SchemeHandlerHelper
Returns a new instance of SchemeHandlerHelper.
165 166 167 168 |
# File 'lib/puppet/pops/binder/bindings_composer.rb', line 165 def initialize(scope) @scope = scope @cache = nil end |
Instance Method Details
#[](scheme) ⇒ Object
169 170 171 172 |
# File 'lib/puppet/pops/binder/bindings_composer.rb', line 169 def [] (scheme) load_schemes unless @cache @cache[scheme] end |
#load_schemes ⇒ Object
174 175 176 |
# File 'lib/puppet/pops/binder/bindings_composer.rb', line 174 def load_schemes @cache = @scope.compiler.boot_injector.lookup(@scope, HASH_OF_HANDLER, Puppet::Plugins::BindingSchemes::BINDINGS_SCHEMES_KEY) || {} end |