Class: Puppet::Pops::Loader::NullLoader
- Defined in:
- lib/puppet/pops/loader/null_loader.rb
Overview
The null loader is empty and delegates everything to its parent if it has one.
Instance Attribute Summary collapse
- #loader_name ⇒ Object readonly
Instance Method Summary collapse
-
#find(name) ⇒ Object
Finds nothing, there are no entries.
-
#get_entry(typed_name) ⇒ Object
Has no entries on its own - always nil.
-
#initialize(parent_loader = nil, loader_name = "null-loader") ⇒ NullLoader
constructor
Construct a NullLoader, optionally with a parent loader.
- #load_typed(typed_name) ⇒ Object
-
#parent ⇒ Object
Has parent if one was set when constructed.
-
#set_entry(typed_name, value, origin = nil) ⇒ Object
Cannot store anything.
- #to_s ⇒ Object
Methods inherited from Loader
Constructor Details
#initialize(parent_loader = nil, loader_name = "null-loader") ⇒ NullLoader
Construct a NullLoader, optionally with a parent loader
8 9 10 11 |
# File 'lib/puppet/pops/loader/null_loader.rb', line 8 def initialize(parent_loader=nil, loader_name = "null-loader") @loader_name = loader_name @parent = parent_loader end |
Instance Attribute Details
#loader_name ⇒ Object (readonly)
4 5 6 |
# File 'lib/puppet/pops/loader/null_loader.rb', line 4 def loader_name @loader_name end |
Instance Method Details
#find(name) ⇒ Object
Finds nothing, there are no entries
32 33 34 |
# File 'lib/puppet/pops/loader/null_loader.rb', line 32 def find(name) nil end |
#get_entry(typed_name) ⇒ Object
Has no entries on its own - always nil
27 28 29 |
# File 'lib/puppet/pops/loader/null_loader.rb', line 27 def get_entry(typed_name) nil end |
#load_typed(typed_name) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/puppet/pops/loader/null_loader.rb', line 18 def load_typed(typed_name) if @parent.nil? nil else @parent.load_typed(typed_name) end end |
#parent ⇒ Object
Has parent if one was set when constructed
14 15 16 |
# File 'lib/puppet/pops/loader/null_loader.rb', line 14 def parent @parent end |
#set_entry(typed_name, value, origin = nil) ⇒ Object
Cannot store anything
37 38 39 |
# File 'lib/puppet/pops/loader/null_loader.rb', line 37 def set_entry(typed_name, value, origin = nil) nil end |
#to_s ⇒ Object
41 42 43 |
# File 'lib/puppet/pops/loader/null_loader.rb', line 41 def to_s() "(NullLoader '#{loader_name}')" end |