Sha256: 19c883c6d8e6cf616006da1b447807fda067b4229731f881ba15f212b0998bfc

Contents?: true

Size: 737 Bytes

Versions: 12

Compression:

Stored size: 737 Bytes

Contents

module Vagrant
  module Action
    module Builtin
      # This class is used to delay execution until the end of
      # a configured stack
      class Delayed
        # @param [Object] callable The object to call (must respond to #call)
        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

        def call(env)
          # Allow the rest of the call stack to execute
          @app.call(env)
          # Now call our delayed stack
          @callable.call(env)
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
vagrant-unbundled-2.3.6.0 lib/vagrant/action/builtin/delayed.rb
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/lib/vagrant/action/builtin/delayed.rb
vagrant-unbundled-2.3.3.0 lib/vagrant/action/builtin/delayed.rb
vagrant-unbundled-2.3.2.0 lib/vagrant/action/builtin/delayed.rb
vagrant-unbundled-2.2.19.0 lib/vagrant/action/builtin/delayed.rb
vagrant-unbundled-2.2.18.0 lib/vagrant/action/builtin/delayed.rb
vagrant-unbundled-2.2.16.0 lib/vagrant/action/builtin/delayed.rb
vagrant-unbundled-2.2.14.0 lib/vagrant/action/builtin/delayed.rb
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/lib/vagrant/action/builtin/delayed.rb
vagrant-unbundled-2.2.10.0 lib/vagrant/action/builtin/delayed.rb
vagrant-unbundled-2.2.9.0 lib/vagrant/action/builtin/delayed.rb
vagrant-unbundled-2.2.8.0 lib/vagrant/action/builtin/delayed.rb