Class: VagrantPlugins::Utm::Action::Created

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant_utm/action/created.rb

Overview

This class will set the result to be true if the machine is created.

Instance Method Summary collapse

Constructor Details

#initialize(app, _env) ⇒ Created

Returns a new instance of Created.



11
12
13
# File 'lib/vagrant_utm/action/created.rb', line 11

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

Instance Method Details

#call(env) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/vagrant_utm/action/created.rb', line 15

def call(env)
  # Set the result to be true if the machine is created.
  env[:result] = env[:machine].state.id != :not_created

  # Call the next if we have one (but we shouldn't, since this
  # middleware is built to run with the Call-type middlewares)
  @app.call(env)
end