Class: VagrantPlugins::Vrealize::Action::IsCreated

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-vrealize/action/is_created.rb

Overview

This can be used with “Call” built-in to check if the machine is created and branch in the middleware.

Constant Summary collapse

NotCreatedStatuses =
%i{
  not_created
  DELETED
}

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ IsCreated

Returns a new instance of IsCreated.



9
10
11
# File 'lib/vagrant-vrealize/action/is_created.rb', line 9

def initialize(app, env)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



18
19
20
21
# File 'lib/vagrant-vrealize/action/is_created.rb', line 18

def call(env)
  env[:result] = created?(env[:machine])
  @app.call(env)
end