Class: VagrantPlugins::Utm::Action::CheckCreated
- Inherits:
-
Object
- Object
- VagrantPlugins::Utm::Action::CheckCreated
- Defined in:
- lib/vagrant_utm/action/check_created.rb
Overview
This middleware checks that the VM is created, and raises an exception if it is not, notifying the user that creation is required.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, _env) ⇒ CheckCreated
constructor
A new instance of CheckCreated.
Constructor Details
#initialize(app, _env) ⇒ CheckCreated
Returns a new instance of CheckCreated.
12 13 14 |
# File 'lib/vagrant_utm/action/check_created.rb', line 12 def initialize(app, _env) @app = app end |
Instance Method Details
#call(env) ⇒ Object
16 17 18 19 20 |
# File 'lib/vagrant_utm/action/check_created.rb', line 16 def call(env) raise Vagrant::Errors::VMNotCreatedError if env[:machine].state.id == :not_created @app.call(env) end |