Sha256: cc414b1bc2cd99bf0ddb0add875206724a63fd980739d8fcc383589e03745e66

Contents?: true

Size: 881 Bytes

Versions: 126

Compression:

Stored size: 881 Bytes

Contents

# The null loader is empty and delegates everything to its parent if it has one.
#
class Puppet::Pops::Loader::NullLoader < Puppet::Pops::Loader::Loader
  attr_reader :loader_name

  # Construct a NullLoader, optionally with a parent loader
  #
  def initialize(parent_loader=nil, loader_name = "null-loader")
    @loader_name = loader_name
    @parent = parent_loader
  end

  # Has parent if one was set when constructed
  def parent
    @parent
  end

  def load_typed(typed_name)
    if @parent.nil?
      nil
    else
      @parent.load_typed(typed_name)
    end
  end

  # Has no entries on its own - always nil
  def get_entry(typed_name)
    nil
  end

  # Finds nothing, there are no entries
  def find(name)
    nil
  end

  # Cannot store anything
  def set_entry(typed_name, value, origin = nil)
    nil
  end

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

Version data entries

126 entries across 126 versions & 2 rubygems

Version Path
puppet-retrospec-1.5.0 vendor/gems/puppet-4.5.2/lib/puppet/pops/loader/null_loader.rb
puppet-retrospec-1.4.1 vendor/gems/puppet-4.5.2/lib/puppet/pops/loader/null_loader.rb
puppet-retrospec-1.4.0 vendor/gems/puppet-4.5.2/lib/puppet/pops/loader/null_loader.rb
puppet-retrospec-1.3.2 vendor/gems/puppet-4.5.2/lib/puppet/pops/loader/null_loader.rb
puppet-retrospec-1.3.1 vendor/gems/puppet-4.5.2/lib/puppet/pops/loader/null_loader.rb
puppet-retrospec-1.3.0 vendor/gems/puppet-4.5.2/lib/puppet/pops/loader/null_loader.rb
puppet-retrospec-1.2.1 vendor/gems/puppet-4.5.2/lib/puppet/pops/loader/null_loader.rb
puppet-retrospec-1.2.0 vendor/gems/puppet-4.5.2/lib/puppet/pops/loader/null_loader.rb
puppet-retrospec-1.1.0 vendor/gems/puppet-4.5.2/lib/puppet/pops/loader/null_loader.rb
puppet-4.5.3 lib/puppet/pops/loader/null_loader.rb
puppet-4.5.3-x86-mingw32 lib/puppet/pops/loader/null_loader.rb
puppet-4.5.3-x64-mingw32 lib/puppet/pops/loader/null_loader.rb
puppet-4.5.3-universal-darwin lib/puppet/pops/loader/null_loader.rb
puppet-retrospec-1.0.0 vendor/gems/puppet-4.5.2/lib/puppet/pops/loader/null_loader.rb
puppet-4.5.2 lib/puppet/pops/loader/null_loader.rb
puppet-4.5.2-x86-mingw32 lib/puppet/pops/loader/null_loader.rb
puppet-4.5.2-x64-mingw32 lib/puppet/pops/loader/null_loader.rb
puppet-4.5.2-universal-darwin lib/puppet/pops/loader/null_loader.rb
puppet-4.5.1 lib/puppet/pops/loader/null_loader.rb
puppet-4.5.1-x86-mingw32 lib/puppet/pops/loader/null_loader.rb