Class: ImageBuilder::PostProcessors::Vagrant

Inherits:
Base
  • Object
show all
Defined in:
lib/image_builder/post_processors/vagrant.rb

Overview

Generic class doc comment

Constant Summary

Constants included from ImageBuilder

VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeVagrant

Returns a new instance of Vagrant.



16
17
18
19
20
# File 'lib/image_builder/post_processors/vagrant.rb', line 16

def initialize
  @type = 'vagrant'
  @compression_level = 6
  @keep_input_artifact = false
end

Instance Attribute Details

#compression_levelObject

Returns the value of attribute compression_level.



7
8
9
# File 'lib/image_builder/post_processors/vagrant.rb', line 7

def compression_level
  @compression_level
end

#includeObject

Returns the value of attribute include.



8
9
10
# File 'lib/image_builder/post_processors/vagrant.rb', line 8

def include
  @include
end

#keep_input_artifactObject

Returns the value of attribute keep_input_artifact.



9
10
11
# File 'lib/image_builder/post_processors/vagrant.rb', line 9

def keep_input_artifact
  @keep_input_artifact
end

#outputObject

Returns the value of attribute output.



10
11
12
# File 'lib/image_builder/post_processors/vagrant.rb', line 10

def output
  @output
end

#overrideObject

Returns the value of attribute override.



12
13
14
# File 'lib/image_builder/post_processors/vagrant.rb', line 12

def override
  @override
end

#typeObject (readonly)

Returns the value of attribute type.



14
15
16
# File 'lib/image_builder/post_processors/vagrant.rb', line 14

def type
  @type
end

#vagrantfile_templateObject

Returns the value of attribute vagrantfile_template.



11
12
13
# File 'lib/image_builder/post_processors/vagrant.rb', line 11

def vagrantfile_template
  @vagrantfile_template
end

Instance Method Details

#add_override(provider, override_hash) ⇒ Object



22
23
24
# File 'lib/image_builder/post_processors/vagrant.rb', line 22

def add_override(provider, override_hash)
  @override[provider] = override_hash
end

#packer_hashObject



26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/image_builder/post_processors/vagrant.rb', line 26

def packer_hash
  hash = {}

  attr_to_hash(hash, :type, true)
  attr_to_hash(hash, :compression_level)
  attr_to_hash(hash, :include)
  attr_to_hash(hash, :keep_input_artifact)
  attr_to_hash(hash, :output)
  attr_to_hash(hash, :vagrantfile_template)
  attr_to_hash(hash, :override)

  hash
end