Class: VagrantPlugins::VagrantDotenv::Action::IsEnabled

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-dotenv/action/is_enabled.rb

Overview

Middleware which uses configuration to check to see if Dotenv plugin has been enabled to run.

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ IsEnabled

Returns a new instance of IsEnabled.



10
11
12
# File 'lib/vagrant-dotenv/action/is_enabled.rb', line 10

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

Instance Method Details

#call(env) ⇒ Object



14
15
16
17
# File 'lib/vagrant-dotenv/action/is_enabled.rb', line 14

def call(env)
  env[:result] = plugin_enabled?(env[:global_config])
  @app.call(env)
end