Class: Puppet::Pops::Loader::PredefinedLoader
- Inherits:
-
BaseLoader
- Object
- Loader
- BaseLoader
- Puppet::Pops::Loader::PredefinedLoader
- Defined in:
- lib/puppet/pops/loader/predefined_loader.rb
Overview
A PredefinedLoader is a loader that is manually populated with loaded elements before being used. It never loads anything on its own. When searching for a type, it must exist or an error is raised
Constant Summary
Constants inherited from Loader
Instance Attribute Summary
Attributes inherited from BaseLoader
Attributes inherited from Loader
Instance Method Summary collapse
-
#allow_shadowing? ⇒ Boolean
Allows shadowing since this loader is used internally for things like function local types And they should win as there is otherwise a risk that the local types clash with built in types that were added after the function was written, or by resource types loaded by the 3x auto loader.
- #find(typed_name) ⇒ Object
- #to_s ⇒ Object
Methods inherited from BaseLoader
#add_entry, #get_entry, #initialize, #load_typed, #loaded_entry, #promote_entry, #remove_entry, #set_entry
Methods inherited from Loader
#[], #get_entry, #initialize, #inspect, #load, #load_typed, #loadables, #loaded_entry, #parent, #private_loader, #set_entry
Constructor Details
This class inherits a constructor from Puppet::Pops::Loader::BaseLoader
Instance Method Details
#allow_shadowing? ⇒ Boolean
Allows shadowing since this loader is used internally for things like function local types And they should win as there is otherwise a risk that the local types clash with built in types that were added after the function was written, or by resource types loaded by the 3x auto loader.
24 25 26 |
# File 'lib/puppet/pops/loader/predefined_loader.rb', line 24 def allow_shadowing? true end |
#find(typed_name) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/puppet/pops/loader/predefined_loader.rb', line 8 def find(typed_name) if typed_name.type == :type raise Puppet::Pops::Loaders::LoaderError, "Cannot load undefined type '#{typed_name.name.capitalize}'" else nil end end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/puppet/pops/loader/predefined_loader.rb', line 16 def to_s() "(PredefinedLoader '#{loader_name}')" end |