Class: Puppet::Pops::Loaders::LoaderModuleData Private

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/pops/loaders.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.

LoaderModuleData

Information about a Module and its loaders. TODO: should have reference to real model element containing all module data; this is faking it TODO: Should use Puppet::Module to get the metadata (as a hash) - a somewhat blunt instrument, but that is

what is available with a reasonable API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(puppet_module) ⇒ LoaderModuleData

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 a new instance of LoaderModuleData.

Parameters:

  • puppet_module (Puppet::Module)

    the module instance for the module being represented



467
468
469
470
471
472
# File 'lib/puppet/pops/loaders.rb', line 467

def initialize(puppet_module)
  @puppet_module = puppet_module
  @resolutions = []
  @public_loader = nil
  @private_loader = nil
end

Instance Attribute Details

#private_loaderObject

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.



459
460
461
# File 'lib/puppet/pops/loaders.rb', line 459

def private_loader
  @private_loader
end

#public_loaderObject

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.



458
459
460
# File 'lib/puppet/pops/loaders.rb', line 458

def public_loader
  @public_loader
end

#puppet_moduleObject (readonly)

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.

The Puppet::Module this LoaderModuleData represents in the loader configuration



463
464
465
# File 'lib/puppet/pops/loaders.rb', line 463

def puppet_module
  @puppet_module
end

#resolutionsObject

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.



460
461
462
# File 'lib/puppet/pops/loaders.rb', line 460

def resolutions
  @resolutions
end

Instance Method Details

#dependency_namesObject

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.



498
499
500
# File 'lib/puppet/pops/loaders.rb', line 498

def dependency_names
  @puppet_module.dependencies_as_modules.collect(&:name)
end

#nameObject

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.



474
475
476
# File 'lib/puppet/pops/loaders.rb', line 474

def name
  @puppet_module.name
end

#pathObject

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.



482
483
484
# File 'lib/puppet/pops/loaders.rb', line 482

def path
  @puppet_module.path
end

#resolved?Boolean

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:

  • (Boolean)


486
487
488
# File 'lib/puppet/pops/loaders.rb', line 486

def resolved?
  !@private_loader.nil?
end

#restrict_to_dependencies?Boolean

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:

  • (Boolean)


490
491
492
# File 'lib/puppet/pops/loaders.rb', line 490

def restrict_to_dependencies?
  @puppet_module.has_metadata?
end

#unmet_dependencies?Boolean

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:

  • (Boolean)


494
495
496
# File 'lib/puppet/pops/loaders.rb', line 494

def unmet_dependencies?
  @puppet_module.unmet_dependencies.any?
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.



478
479
480
# File 'lib/puppet/pops/loaders.rb', line 478

def version
  @puppet_module.version
end