Class: VagrantPlugins::AVF::Action::Halt

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant_provider_avf/action/halt.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, _env, machine_id_store:, driver:) ⇒ Halt

Returns a new instance of Halt.



15
16
17
18
19
# File 'lib/vagrant_provider_avf/action/halt.rb', line 15

def initialize(app, _env, machine_id_store:, driver:)
  @app = app
  @machine_id_store = machine_id_store
  @driver = driver
end

Instance Method Details

#call(env) ⇒ Object



21
22
23
24
25
# File 'lib/vagrant_provider_avf/action/halt.rb', line 21

def call(env)
  machine_id = @machine_id_store.fetch
  @driver.stop(machine_id) unless blank?(machine_id) || stopped?(machine_id)
  @app.call(env)
end