Class: VagrantPlugins::Vultr::Action::PowerOff
- Inherits:
-
Object
- Object
- VagrantPlugins::Vultr::Action::PowerOff
- Includes:
- Helpers::Client
- Defined in:
- lib/vagrant-vultr/action/power_off.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ PowerOff
constructor
A new instance of PowerOff.
Methods included from Helpers::Client
Constructor Details
#initialize(app, env) ⇒ PowerOff
Returns a new instance of PowerOff.
9 10 11 12 13 14 |
# File 'lib/vagrant-vultr/action/power_off.rb', line 9 def initialize(app, env) @app = app @machine = env[:machine] @client = client @logger = Log4r::Logger.new('vagrant::vultr::power_off') end |
Instance Method Details
#call(env) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/vagrant-vultr/action/power_off.rb', line 16 def call(env) @client.stop_server(@machine.id) env[:ui].info 'Machine is stopped.' @app.call(env) end |