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



319
320
321
322
323
324
# File 'lib/puppet/pops/loaders.rb', line 319

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.



311
312
313
# File 'lib/puppet/pops/loaders.rb', line 311

def private_loader
  @private_loader
end

#public_loaderObject

Returns the value of attribute public_loader.



310
311
312
# File 'lib/puppet/pops/loaders.rb', line 310

def public_loader
  @public_loader
end

#puppet_moduleObject (readonly)

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



315
316
317
# File 'lib/puppet/pops/loaders.rb', line 315

def puppet_module
  @puppet_module
end

#resolutionsObject

Returns the value of attribute resolutions.



312
313
314
# File 'lib/puppet/pops/loaders.rb', line 312

def resolutions
  @resolutions
end

Instance Method Details

#dependency_namesObject



350
351
352
# File 'lib/puppet/pops/loaders.rb', line 350

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

#nameObject



326
327
328
# File 'lib/puppet/pops/loaders.rb', line 326

def name
  @puppet_module.name
end

#pathObject



334
335
336
# File 'lib/puppet/pops/loaders.rb', line 334

def path
  @puppet_module.path
end

#resolved?Boolean

Returns:

  • (Boolean)


338
339
340
# File 'lib/puppet/pops/loaders.rb', line 338

def resolved?
  !@private_loader.nil?
end

#restrict_to_dependencies?Boolean

Returns:

  • (Boolean)


342
343
344
# File 'lib/puppet/pops/loaders.rb', line 342

def restrict_to_dependencies?
  @puppet_module.has_metadata?
end

#unmet_dependencies?Boolean

Returns:

  • (Boolean)


346
347
348
# File 'lib/puppet/pops/loaders.rb', line 346

def unmet_dependencies?
  @puppet_module.unmet_dependencies.any?
end

#versionObject



330
331
332
# File 'lib/puppet/pops/loaders.rb', line 330

def version
  @puppet_module.version
end