class HashiCorp::VagrantVMwareDesktop::Action::Suspended

This can be used with “Call” built-in to check if the machine is suspended.

Public Class Methods

new(app, env) click to toggle source
# File lib/vagrant-vmware-desktop/action/suspended.rb, line 11
def initialize(app, env)
  @app = app
  @logger = Log4r::Logger.new("hashicorp::provider::vmware::suspended")
end

Public Instance Methods

call(env) click to toggle source
# File lib/vagrant-vmware-desktop/action/suspended.rb, line 16
def call(env)
  env[:result] = env[:machine].state.id == :suspended
  @logger.debug("result: #{env[:result].inspect}")
  @app.call(env)
end