Class: VagrantPlugins::Utm::Action::Resume

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

Overview

This action is responsible for resuming the VM.

Instance Method Summary collapse

Constructor Details

#initialize(app, _env) ⇒ Resume

Returns a new instance of Resume.



8
9
10
# File 'lib/vagrant_utm/action/resume.rb', line 8

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

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/vagrant_utm/action/resume.rb', line 12

def call(env)
  current_state = env[:machine].state.id
  if current_state == :paused
    env[:ui].info I18n.t("vagrant.actions.vm.resume.unpausing")
    env[:machine].provider.driver.start
  end

  @app.call(env)
end