Class: VagrantPlugins::Packet::Action::IsStopped
- Inherits:
-
Object
- Object
- VagrantPlugins::Packet::Action::IsStopped
- Defined in:
- lib/vagrant-packet/action/is_stopped.rb
Overview
This can be used with “Call” built-in to check if the machine is stopped and branch in the middleware.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, _env) ⇒ IsStopped
constructor
A new instance of IsStopped.
Constructor Details
#initialize(app, _env) ⇒ IsStopped
Returns a new instance of IsStopped.
9 10 11 |
# File 'lib/vagrant-packet/action/is_stopped.rb', line 9 def initialize(app, _env) @app = app end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 |
# File 'lib/vagrant-packet/action/is_stopped.rb', line 13 def call(env) env[:result] = env[:machine].state.id == :inactive @app.call(env) end |