Class: VagrantPlugins::Shortcuts::Shortcut

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

Overview

‘Shortcut` handles running shortcuts and any associated options

Instance Method Summary collapse

Constructor Details

#initialize(callable, start_machine: true) ⇒ Shortcut

Returns a new instance of Shortcut.



19
20
21
22
# File 'lib/vagrant-shortcuts.rb', line 19

def initialize(callable, start_machine: true)
  @callable = callable
  @start_machine = start_machine
end

Instance Method Details

#call(machine) ⇒ Object



24
25
26
27
28
29
# File 'lib/vagrant-shortcuts.rb', line 24

def call(machine)
  if @start_machine
    machine.action(:up, {:provision_ignore_sentinel => false})
  end
  @callable.call(machine)
end