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


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

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


441
442
443
# File 'lib/puppet/pops/loaders.rb', line 441

def private_loader
  @private_loader
end

#public_loaderObject

Returns the value of attribute public_loader


440
441
442
# File 'lib/puppet/pops/loaders.rb', line 440

def public_loader
  @public_loader
end

#puppet_moduleObject (readonly)

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


445
446
447
# File 'lib/puppet/pops/loaders.rb', line 445

def puppet_module
  @puppet_module
end

#resolutionsObject

Returns the value of attribute resolutions


442
443
444
# File 'lib/puppet/pops/loaders.rb', line 442

def resolutions
  @resolutions
end

Instance Method Details

#dependency_namesObject


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

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

#nameObject


456
457
458
# File 'lib/puppet/pops/loaders.rb', line 456

def name
  @puppet_module.name
end

#pathObject


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

def path
  @puppet_module.path
end

#resolved?Boolean


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

def resolved?
  !@private_loader.nil?
end

#restrict_to_dependencies?Boolean


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

def restrict_to_dependencies?
  @puppet_module.has_metadata?
end

#unmet_dependencies?Boolean


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

def unmet_dependencies?
  @puppet_module.unmet_dependencies.any?
end

#versionObject


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

def version
  @puppet_module.version
end