Class: Puppet::Plugins::DataProviders::PathBasedDataProviderFactory Abstract Private

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/plugins/data_providers/data_provider.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

This class is abstract.

Factory for creating path based data providers

Since:

  • Puppet 4.0.0

Direct Known Subclasses

FileBasedDataProviderFactory

Instance Method Summary collapse

Instance Method Details

#create(name, paths, parent_data_provider) ⇒ DataProvider

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Create a path based data provider with the given name and paths

Parameters:

  • name (String)

    the name of the created provider (for logging and debugging)

  • paths (Array<String>)

    array of resolved paths

  • parent_data_provider (DataProvider)

    The data provider that is the container of this data provider

Returns:

Raises:

  • (NotImplementedError)

Since:

  • Puppet 4.0.0



259
260
261
# File 'lib/puppet/plugins/data_providers/data_provider.rb', line 259

def create(name, paths, parent_data_provider)
  raise NotImplementedError, "Subclass of PathBasedDataProviderFactory must implement 'create' method"
end

#resolve_paths(datadir, declared_paths, paths, lookup_invocation) ⇒ Array<ResolvedPath>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Resolve the given paths to something that is meaningful as a paths argument when creating a provider using the #create call.

In order to increase efficiency, the implementors of this method should ensure that resolved paths that exists are included in the result.

Parameters:

  • datadir (Pathname)

    The base when creating absolute paths

  • declared_paths (Array<String>)

    paths as found in declaration. May contain interpolation expressions

  • paths (Array<String>)

    paths that have been preprocessed (interpolations resolved)

  • lookup_invocation (Puppet::Pops::Lookup::Invocation)

    The current lookup invocation

Returns:

Since:

  • Puppet 4.0.0



274
275
276
# File 'lib/puppet/plugins/data_providers/data_provider.rb', line 274

def resolve_paths(datadir, declared_paths, paths, lookup_invocation)
  []
end

#versionObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the data provider factory version.

return [Integer] the version of this data provider factory

Since:

  • Puppet 4.0.0



281
282
283
# File 'lib/puppet/plugins/data_providers/data_provider.rb', line 281

def version
  2
end