Class: Puppet::Pops::Loader::LoaderPaths::ResourceTypeImplPP

Inherits:
PuppetSmartPath show all
Defined in:
lib/puppet/pops/loader/loader_paths.rb

Constant Summary collapse

RESOURCE_TYPES_PATH_PP =
'.resource_types'.freeze

Constants inherited from PuppetSmartPath

PuppetSmartPath::EXTENSION

Instance Attribute Summary

Attributes inherited from SmartPath

#generic_path

Instance Method Summary collapse

Methods inherited from PuppetSmartPath

#extension, #typed_name

Methods inherited from SmartPath

#fuzzy_matching?, #initialize, #lib_root?, #typed_name, #valid_name?, #valid_path?

Constructor Details

This class inherits a constructor from Puppet::Pops::Loader::LoaderPaths::SmartPath

Instance Method Details

#effective_path(typed_name, start_index_in_name) ⇒ Object

The effect paths for resource type impl is the full name since resource types are not name spaced. This overrides the default PuppetSmartPath.


308
309
310
311
312
# File 'lib/puppet/pops/loader/loader_paths.rb', line 308

def effective_path(typed_name, start_index_in_name)
  # Resource type to name does not skip the name-space
  # i.e. <module>/mymodule/resource_types/foo.pp is the resource type foo
  "#{File.join(generic_path, typed_name.name_parts)}.pp"
end

#instantiatorObject


300
301
302
# File 'lib/puppet/pops/loader/loader_paths.rb', line 300

def instantiator
  PuppetResourceTypeImplInstantiator
end

#relative_pathObject


292
293
294
# File 'lib/puppet/pops/loader/loader_paths.rb', line 292

def relative_path
  RESOURCE_TYPES_PATH_PP
end

#root_pathObject


296
297
298
# File 'lib/puppet/pops/loader/loader_paths.rb', line 296

def root_path
  @loader.path
end