Class: HashiCorp::VagrantVMwareDesktop::Action::Suspended
- Inherits:
-
Object
- Object
- HashiCorp::VagrantVMwareDesktop::Action::Suspended
- Includes:
- Common
- Defined in:
- lib/vagrant-vmware-desktop/action/suspended.rb
Overview
This can be used with “Call” built-in to check if the machine is suspended.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ Suspended
constructor
A new instance of Suspended.
Methods included from Common
Constructor Details
#initialize(app, env) ⇒ Suspended
Returns a new instance of Suspended.
11 12 13 14 |
# 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 |
Instance Method Details
#call(env) ⇒ Object
16 17 18 19 20 |
# 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 |