Class: PDK::Context::Module

Inherits:
AbstractContext show all
Defined in:
lib/pdk/context/module.rb

Overview

Represents a context for a Puppet Module

Instance Attribute Summary

Attributes inherited from AbstractContext

#context_path

Instance Method Summary collapse

Methods inherited from AbstractContext

#parent_context, #root_path, #to_debug_log, #to_s

Constructor Details

#initialize(module_root, context_path) ⇒ Module

Returns a new instance of Module.

Parameters:

  • module_root (String)

    The root path for the module.

  • context_path (String)

    The path where this context was created from e.g. Dir.pwd

See Also:



10
11
12
13
# File 'lib/pdk/context/module.rb', line 10

def initialize(module_root, context_path)
  super(context_path)
  @root_path = module_root
end

Instance Method Details

#display_nameObject

:nocov:

See Also:

  • AbstractContext.display_name


22
23
24
# File 'lib/pdk/context/module.rb', line 22

def display_name
  'a Puppet Module context'
end

#pdk_compatible?Boolean

Returns:

  • (Boolean)

See Also:

  • AbstractContext.pdk_compatible?


16
17
18
# File 'lib/pdk/context/module.rb', line 16

def pdk_compatible?
  PDK::Util.module_pdk_compatible?(root_path)
end