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

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/pops/loaders.rb

Overview

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

Returns a new instance of LoaderModuleData.

Parameters:

  • puppet_module (Puppet::Module)

    the module instance for the module being represented


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

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

Instance Attribute Details

#private_loaderObject

Returns the value of attribute private_loader


450
451
452
# File 'lib/puppet/pops/loaders.rb', line 450

def private_loader
  @private_loader
end

#public_loaderObject

Returns the value of attribute public_loader


449
450
451
# File 'lib/puppet/pops/loaders.rb', line 449

def public_loader
  @public_loader
end

#puppet_moduleObject (readonly)

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


454
455
456
# File 'lib/puppet/pops/loaders.rb', line 454

def puppet_module
  @puppet_module
end

#resolutionsObject

Returns the value of attribute resolutions


451
452
453
# File 'lib/puppet/pops/loaders.rb', line 451

def resolutions
  @resolutions
end

Instance Method Details

#dependency_namesObject


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

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

#nameObject


465
466
467
# File 'lib/puppet/pops/loaders.rb', line 465

def name
  @puppet_module.name
end

#pathObject


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

def path
  @puppet_module.path
end

#resolved?Boolean

Returns:

  • (Boolean)

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

def resolved?
  !@private_loader.nil?
end

#restrict_to_dependencies?Boolean

Returns:

  • (Boolean)

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

def restrict_to_dependencies?
  @puppet_module.has_metadata?
end

#unmet_dependencies?Boolean

Returns:

  • (Boolean)

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

def unmet_dependencies?
  @puppet_module.unmet_dependencies.any?
end

#versionObject


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

def version
  @puppet_module.version
end