Class: Puppet::Pops::Loader::PredefinedLoader

Inherits:
BaseLoader show all
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.

Constant Summary

Constants inherited from Loader

Loader::LOADABLE_KINDS

Instance Attribute Summary

Attributes inherited from BaseLoader

#parent

Attributes inherited from Loader

#environment, #loader_name

Instance Method Summary collapse

Methods inherited from BaseLoader

#add_entry, #discover, #get_entry, #initialize, #load_typed, #loaded_entry, #promote_entry, #remove_entry, #set_entry

Methods inherited from Loader

#[], #discover, #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.



20
21
22
# File 'lib/puppet/pops/loader/predefined_loader.rb', line 20

def allow_shadowing?
  true
end

#find(typed_name) ⇒ Object



8
9
10
# File 'lib/puppet/pops/loader/predefined_loader.rb', line 8

def find(typed_name)
  nil
end

#synchronize(&block) ⇒ Object



24
25
26
# File 'lib/puppet/pops/loader/predefined_loader.rb', line 24

def synchronize(&block)
  yield
end

#to_sObject



12
13
14
# File 'lib/puppet/pops/loader/predefined_loader.rb', line 12

def to_s()
  "(PredefinedLoader '#{loader_name}')"
end