Class: Vagrant::Action::Builtin::Delayed
- Inherits:
-
Object
- Object
- Vagrant::Action::Builtin::Delayed
- Defined in:
- lib/vagrant/action/builtin/delayed.rb
Overview
This class is used to delay execution until the end of a configured stack
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env, callable) ⇒ Delayed
constructor
A new instance of Delayed.
Constructor Details
#initialize(app, env, callable) ⇒ Delayed
Returns a new instance of Delayed.
8 9 10 11 12 13 14 15 |
# 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 |
Instance Method Details
#call(env) ⇒ Object
17 18 19 20 21 22 |
# 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 |