Class: VagrantPlugins::OVirtProvider::Action::IsRunning
- Inherits:
-
Object
- Object
- VagrantPlugins::OVirtProvider::Action::IsRunning
- Defined in:
- lib/vagrant-ovirt3/action/is_running.rb
Overview
This can be used with “Call” built-in to check if the machine is created 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-ovirt3/action/is_running.rb', line 7 def initialize(app, env) @app = app end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 |
# File 'lib/vagrant-ovirt3/action/is_running.rb', line 11 def call(env) env[:result] = env[:machine].state.id == :up @app.call(env) end |