Class: VagrantPlugins::Skytap::Action::IsRunning
- Defined in:
- lib/vagrant-skytap/action/is_running.rb
Overview
This can be used with “Call” built-in to check if the machine is running and branch in the middleware.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ IsRunning
constructor
A new instance of IsRunning.
Constructor Details
#initialize(app, env) ⇒ IsRunning
Returns a new instance of IsRunning.
7 8 9 10 |
# File 'lib/vagrant-skytap/action/is_running.rb', line 7 def initialize(app, env) @app = app @logger = Log4r::Logger.new("vagrant_skytap::action::is_running") end |
Instance Method Details
#call(env) ⇒ Object
12 13 14 15 |
# File 'lib/vagrant-skytap/action/is_running.rb', line 12 def call(env) env[:result] = env[:machine].state.id == :running @app.call(env) end |