Class: VagrantWizard::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



12
13
14
15
16
17
18
19
# File 'lib/vagrant-wizard/config.rb', line 12

def initialize
  @wizard_path      = UNSET_VALUE
  @defaults_path    = UNSET_VALUE
  @config_path      = UNSET_VALUE
  @prompt_presets   = UNSET_VALUE
  @presets_dir_path = UNSET_VALUE
  @prompt_overwrite = UNSET_VALUE
end

Instance Attribute Details

#config_pathObject

Returns the value of attribute config_path.



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

def config_path
  @config_path
end

#defaults_pathObject

Returns the value of attribute defaults_path.



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

def defaults_path
  @defaults_path
end

#presets_dir_pathObject

Returns the value of attribute presets_dir_path.



9
10
11
# File 'lib/vagrant-wizard/config.rb', line 9

def presets_dir_path
  @presets_dir_path
end

#prompt_overwriteObject

Returns the value of attribute prompt_overwrite.



10
11
12
# File 'lib/vagrant-wizard/config.rb', line 10

def prompt_overwrite
  @prompt_overwrite
end

#prompt_presetsObject

Returns the value of attribute prompt_presets.



8
9
10
# File 'lib/vagrant-wizard/config.rb', line 8

def prompt_presets
  @prompt_presets
end

#wizard_pathObject

Returns the value of attribute wizard_path.



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

def wizard_path
  @wizard_path
end

Instance Method Details

#finalize!Object



21
22
23
24
25
26
27
28
# File 'lib/vagrant-wizard/config.rb', line 21

def finalize!
  @wizard_path      = './config.wizard.yml'   if @wizard_path      == UNSET_VALUE
  @defaults_path    = './config.defaults.yml' if @defaults_path    == UNSET_VALUE
  @config_path      = './config.yml'          if @config_path      == UNSET_VALUE
  @prompt_presets   = true                    if @prompt_presets   == UNSET_VALUE
  @presets_dir_path = './wizard-presets'      if @presets_dir_path == UNSET_VALUE
  @prompt_overwrite = true                    if @prompt_overwrite == UNSET_VALUE
end