Class: VagrantPlugins::ProviderLibvirt::Action::IsRunning
- Inherits:
-
Object
- Object
- VagrantPlugins::ProviderLibvirt::Action::IsRunning
- Defined in:
- lib/vagrant-libvirt/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 |
# File 'lib/vagrant-libvirt/action/is_running.rb', line 7 def initialize(app, _env) @app = app end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 |
# File 'lib/vagrant-libvirt/action/is_running.rb', line 11 def call(env) env[:result] = env[:machine].state.id == :running @app.call(env) end |