Class: VagrantPlugins::Triggers::Action::Trigger
- Inherits:
-
Object
- Object
- VagrantPlugins::Triggers::Action::Trigger
- Defined in:
- lib/vagrant-triggers/action/trigger.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env, condition) ⇒ Trigger
constructor
A new instance of Trigger.
Constructor Details
#initialize(app, env, condition) ⇒ Trigger
Returns a new instance of Trigger.
7 8 9 10 11 12 13 |
# File 'lib/vagrant-triggers/action/trigger.rb', line 7 def initialize(app, env, condition) @app = app @condition = condition @env = env @exit = false @logger = Log4r::Logger.new("vagrant::plugins::triggers::trigger") end |
Instance Method Details
#call(env) ⇒ Object
15 16 17 18 19 |
# File 'lib/vagrant-triggers/action/trigger.rb', line 15 def call(env) fire_triggers unless @condition == :after @app.call(env) unless @exit fire_triggers if @condition == :after end |