Class: VagrantPlugins::Tagprovision::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-tagprovision/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



9
10
11
12
13
14
15
# File 'lib/vagrant-tagprovision/config.rb', line 9

def initialize
  @enabled          = UNSET_VALUE
  @log_provision    = UNSET_VALUE
  @tag_provision    = UNSET_VALUE
  @push_tag         = UNSET_VALUE

end

Instance Attribute Details

#enabledObject

Returns the value of attribute enabled.



4
5
6
# File 'lib/vagrant-tagprovision/config.rb', line 4

def enabled
  @enabled
end

#log_provisionObject

Returns the value of attribute log_provision.



5
6
7
# File 'lib/vagrant-tagprovision/config.rb', line 5

def log_provision
  @log_provision
end

#push_tagObject

Returns the value of attribute push_tag.



7
8
9
# File 'lib/vagrant-tagprovision/config.rb', line 7

def push_tag
  @push_tag
end

#tag_provisionObject

Returns the value of attribute tag_provision.



6
7
8
# File 'lib/vagrant-tagprovision/config.rb', line 6

def tag_provision
  @tag_provision
end

Instance Method Details

#finalize!Object



17
18
19
20
21
22
# File 'lib/vagrant-tagprovision/config.rb', line 17

def finalize!
  @enabled            = false if @enabled == UNSET_VALUE
  @log_provision        = false if @log_provision == UNSET_VALUE
  @tag_provision  = false if @tag_provision == UNSET_VALUE
  @push_tag    = false if @push_tag == UNSET_VALUE
end

#validate(machine) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/vagrant-tagprovision/config.rb', line 24

def validate(machine)
  errors = []

  errors << validate_bool('hostmanager.enabled', @enabled)
  errors << validate_bool('hostmanager.log_provision', @log_provision)
  errors << validate_bool('hostmanager.tag_provision', @tag_provision)
  errors << validate_bool('hostmanager.push_tag', @push_tag)
  errors.compact!

  { "Tagprovision configuration" => errors }
end