Class: VagrantPlugins::Vultr::Action::Destroy
- Inherits:
-
Object
- Object
- VagrantPlugins::Vultr::Action::Destroy
- Includes:
- Helpers::Client
- Defined in:
- lib/vagrant-vultr/action/destroy.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ Destroy
constructor
A new instance of Destroy.
Methods included from Helpers::Client
Constructor Details
#initialize(app, env) ⇒ Destroy
Returns a new instance of Destroy.
9 10 11 12 13 14 |
# File 'lib/vagrant-vultr/action/destroy.rb', line 9 def initialize(app, env) @app = app @machine = env[:machine] @client = client @logger = Log4r::Logger.new('vagrant::vultr::destroy') end |
Instance Method Details
#call(env) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/vagrant-vultr/action/destroy.rb', line 16 def call(env) @client.destroy_server(@machine.id) env[:ui].info 'Waiting for server to be destroyed...' @client.wait_to_destroy(@machine.id) env[:ui].info 'Machine is destroyed.' @machine.id = nil @app.call(env) end |