Class: VagrantPlugins::Memset::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::Memset::Config
- Defined in:
- lib/vagrant-memset/config.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Memset api key.
-
#discount_code ⇒ Object
Discount code.
-
#dry_run ⇒ Object
Test run.
-
#os ⇒ Object
Image.
-
#sku ⇒ Object
Memset vps model.
-
#vlan ⇒ Object
Vlan name.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #validate(machine) ⇒ Object
Constructor Details
#initialize ⇒ Config
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_key ⇒ Object
Memset api key
8 9 10 |
# File 'lib/vagrant-memset/config.rb', line 8 def api_key @api_key end |
#discount_code ⇒ Object
Discount code
17 18 19 |
# File 'lib/vagrant-memset/config.rb', line 17 def discount_code @discount_code end |
#dry_run ⇒ Object
Test run
23 24 25 |
# File 'lib/vagrant-memset/config.rb', line 23 def dry_run @dry_run end |
#os ⇒ Object
Image
14 15 16 |
# File 'lib/vagrant-memset/config.rb', line 14 def os @os end |
#sku ⇒ Object
Memset vps model
11 12 13 |
# File 'lib/vagrant-memset/config.rb', line 11 def sku @sku end |
#vlan ⇒ Object
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 |