Class: VagrantPlugins::Memset::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



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

def initialize
  @api_key = UNSET_VALUE
  @sku = UNSET_VALUE
  @os = UNSET_VALUE
  @discount_code = UNSET_VALUE
  @vlan = UNSET_VALUE
	@dry_run = UNSET_VALUE
end

Instance Attribute Details

#api_keyObject

Memset api key



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

def api_key
  @api_key
end

#discount_codeObject

Discount code



17
18
19
# File 'lib/vagrant-memset/config.rb', line 17

def discount_code
  @discount_code
end

#dry_runObject

Test run



23
24
25
# File 'lib/vagrant-memset/config.rb', line 23

def dry_run
  @dry_run
end

#osObject

Image



14
15
16
# File 'lib/vagrant-memset/config.rb', line 14

def os
  @os
end

#skuObject

Memset vps model



11
12
13
# File 'lib/vagrant-memset/config.rb', line 11

def sku
  @sku
end

#vlanObject

Vlan name



20
21
22
# File 'lib/vagrant-memset/config.rb', line 20

def vlan
  @vlan
end

Instance Method Details

#finalize!Object



34
35
36
37
38
39
40
41
42
# File 'lib/vagrant-memset/config.rb', line 34

def finalize!
  @api_key = nil if api_key == UNSET_VALUE
  @sku = nil if @sku == UNSET_VALUE
  @os = nil if @os == UNSET_VALUE
  @discount_code = nil if @discount == UNSET_VALUE
  @vlan = nil if @vlan == UNSET_VALUE
  @dry_run = /True/ if @dry_run == UNSET_VALUE	
  
end

#validate(machine) ⇒ Object



44
45
46
47
# File 'lib/vagrant-memset/config.rb', line 44

def validate (machine)
    errors = []
    { "Memset Provider" => errors }
end