Class: VagrantPlugins::Utm::Action::Destroy

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant_utm/action/destroy.rb

Overview

This action destroys the running machine.

Instance Method Summary collapse

Constructor Details

#initialize(app, _env) ⇒ Destroy

Returns a new instance of Destroy.



11
12
13
# File 'lib/vagrant_utm/action/destroy.rb', line 11

def initialize(app, _env)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/vagrant_utm/action/destroy.rb', line 15

def call(env)
  env[:ui].info I18n.t("vagrant.actions.vm.destroy.destroying")
  env[:machine].provider.driver.delete
  env[:machine].id = nil

  @app.call(env)
end