class Vagrant::Action::Builtin::Delayed

This class is used to delay execution until the end of a configured stack

Public Class Methods

new(app, env, callable) click to toggle source

@param [Object] callable The object to call (must respond to call)

# File lib/vagrant/action/builtin/delayed.rb, line 8
def initialize(app, env, callable)
  if !callable.respond_to?(:call)
    raise TypeError, "Callable argument is expected to respond to `#call`"
  end
  @app         = app
  @env         = env
  @callable    = callable
end

Public Instance Methods

call(env) click to toggle source
# File lib/vagrant/action/builtin/delayed.rb, line 17
def call(env)
  # Allow the rest of the call stack to execute
  @app.call(env)
  # Now call our delayed stack
  @callable.call(env)
end