Class: Bolt::ModuleInstaller::Puppetfile::GitModule

Inherits:
Module
  • Object
show all
Defined in:
lib/bolt/module_installer/puppetfile/git_module.rb

Instance Attribute Summary collapse

Attributes inherited from Module

#full_name, #name, #type

Instance Method Summary collapse

Constructor Details

#initialize(name, git, ref) ⇒ GitModule

Returns a new instance of GitModule.



13
14
15
16
17
18
# File 'lib/bolt/module_installer/puppetfile/git_module.rb', line 13

def initialize(name, git, ref)
  super(name)
  @git  = git
  @ref  = ref
  @type = :git
end

Instance Attribute Details

#gitObject (readonly)

Returns the value of attribute git.



11
12
13
# File 'lib/bolt/module_installer/puppetfile/git_module.rb', line 11

def git
  @git
end

#refObject (readonly)

Returns the value of attribute ref.



11
12
13
# File 'lib/bolt/module_installer/puppetfile/git_module.rb', line 11

def ref
  @ref
end

Instance Method Details

#to_hashObject

Returns a hash that can be used to create a module specification.



28
29
30
31
32
33
# File 'lib/bolt/module_installer/puppetfile/git_module.rb', line 28

def to_hash
  {
    'git' => @git,
    'ref' => @ref
  }
end

#to_specObject

Returns a Puppetfile module specification.



22
23
24
# File 'lib/bolt/module_installer/puppetfile/git_module.rb', line 22

def to_spec
  "mod '#{@name}',\n  git: '#{@git}',\n  ref: '#{@ref}'"
end