Class: VagrantPlugins::Vultr::Action::CheckState

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-vultr/action/check_state.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ CheckState

Returns a new instance of CheckState.



5
6
7
8
9
# File 'lib/vagrant-vultr/action/check_state.rb', line 5

def initialize(app, env)
  @app = app
  @machine = env[:machine]
  @logger = Log4r::Logger.new('vagrant::vultr::check_state')
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
15
16
# File 'lib/vagrant-vultr/action/check_state.rb', line 11

def call(env)
  env[:machine_state] = @machine.state.id
  @logger.info "Machine state is '#{@machine.state.id}'."

  @app.call(env)
end