Class: VagrantPlugins::Sakura::Provider

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-sakura/provider.rb

Instance Method Summary collapse

Constructor Details

#initialize(machine) ⇒ Provider

Returns a new instance of Provider.



7
8
9
# File 'lib/vagrant-sakura/provider.rb', line 7

def initialize(machine)
  @machine = machine
end

Instance Method Details

#action(name) ⇒ Object



11
12
13
14
15
# File 'lib/vagrant-sakura/provider.rb', line 11

def action(name)
  action_method = "action_#{name}"
  return Action.send(action_method) if Action.respond_to?(action_method)
  nil
end

#ssh_infoObject



17
18
19
20
# File 'lib/vagrant-sakura/provider.rb', line 17

def ssh_info
  env = @machine.action("read_ssh_info")
  env[:machine_ssh_info]
end

#stateObject



22
23
24
25
26
27
28
# File 'lib/vagrant-sakura/provider.rb', line 22

def state
  env = @machine.action("read_state")
  state_id = env[:machine_state_id]
  short = state_id.to_s
  long = I18n.t("vagrant_sakura.state_#{short}")
  Vagrant::MachineState.new(state_id.to_sym, short, long)
end