Class: VagrantProtect::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-protect/command.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ Command

Returns a new instance of Command.



7
8
9
10
# File 'lib/vagrant-protect/command.rb', line 7

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

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/vagrant-protect/command.rb', line 12

def call(env)
  if env[:machine].config.protect.enabled 
    env[:ui].info "You can not shutdown the instance because destroy command is disabled in the configuration"
    return
  end
  @app.call(env)
end